Can I get remote IP address inside
@OnOpen
@ServletEndpoint
The JSR-356 Websocket specification does not expose client IP address.
You may try one of the 2 hacks descibed in this response: JSR-356 WebSockets with Tomcat - How to limit connections within single IP address?