Package io.mats3.matssocket.impl
Class RemoteAddressContainerHacks
java.lang.Object
io.mats3.matssocket.impl.RemoteAddressContainerHacks
Provides several hacks to get the Remote Address for different Servlet Containers implementing JSR 356 Java API for
WebSockets, as that standard does not specify a method for it. Currently tries to get a Remote Address using the
following hacks (If you can provide more, let us know!):
- Jetty (tested): Property on the User Properties map on WebSocket Session - check Jetty's class "JsrCreator": https://stackoverflow.com/a/36028476/39334
- Glassfish / Tyrus (not tested!): Reflect method "getRemoteAddr()" on WebSocket Session (which is a TyrusSession): https://stackoverflow.com/a/25110850/39334
- Tomcat (not tested!): Reflect a series of fields from Session.getAsyncRemote() (Session is a WsSession): https://stackoverflow.com/a/32629586/39334
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
attemptGetRemoteAddress
(javax.websocket.Session session)
-
Constructor Details
-
RemoteAddressContainerHacks
public RemoteAddressContainerHacks()
-
-
Method Details
-
attemptGetRemoteAddress
-