You could try request.getRemoteAddr() which returns the IP address as a string.
however, the ip address might belong to a proxy server.
it is the same as the cgi vairable REMOTE_ADDR.
Bo Xu <[EMAIL PROTECTED]> on 05/18/2000 05:33:08 PM
Please respond to "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Rajesh Shedde/ELISG/SAIC)
Subject: how to know the IP address of a "client" from servlet?
Hi,
If my servlet "received a request from a client", how can I know the IP
address of this client ? because now I am developing a "RTP server", and I
need to know the IP address of this client, then I can send RTP stream to him.
If I use "TCP socket", I can use "s.getInetAddress().getHostAddress()" to get
the IP address of this client. But how to do it with a servlet?
Thanks in advance!
Bo
May 18,2000
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html