Open lapo-luchini opened 6 years ago
Note: The Jetty project exposes the local and remote InetAdddress (along with other handshake values) in the Session.userProperties as well.
Under the names javax.websocket.endpoint.remoteAddress
and javax.websocket.endpoint.localAddress
.
Uh, yes, I wrote "getty" but I meant "jetty". 😇
AFAICT it is currently impossible (except using reflection to access specific implementation’s private properties) to retrieve the connecting user’s IP address. Just as in ordinary HTTP connections, it could be useful to know that. To avoid changing the APIs I guess it could be added to the existing session user properties (as done e.g. by
GettyJetty), but any standard way to obtain that would be useful, really, even adding it toHandshakeRequest
and accessing in the way suggested in #218.