Before I bounce this again to the Sockets and Internet Protocol forum, how are you trying to get the IP address? I mean, there is a whole bunch of ways. If you are doing this is in a servlet, I think there are some ways to get header information that may contain IP addresses (though it may just be host names). ...
Hi Folks, We have a requirement to capture the IP address of the end user machine who is browsing the web site. The method getRemoteAddr() on the Request interface gives the IP address of the last proxy that send the request. So this is out of choice. In search of the same, i was studying the http headers and found "X_FORWARDED_FOR" ...
public void readLine(DataInputStream dis) { try { boolean end = false; String lineEnd = "\n"; //assumes that the end of the line is marked with this byte[] lineEndBytes = lineEnd.getBytes(); byte[] byteBuf = new byte[lineEndBytes.length]; while(!end) { String t = ""; if(byteBuf != null) { dis.read(byteBuf,0,lineEndBytes.length); t = new String(byteBuf); } System.out.print(t); if(t.equals(lineEnd)) end=true; }// while } catch(Exception e) { e.printStackTrace(); ...