Http session isn't available from com.codeminders.socketio.server.Socket with websocket transport at least in Jetty 9.4.7 because of method org.eclipse.jetty.websocket.servlet.UpgradeHttpServletRequest#complete :
public void complete()
{
request = null;
}
As a workaround I have overridden WebsocketConfigurator#modifyHandshake :
@Override
public void modifyHandshake(
ServerEndpointConfig config,
HandshakeRequest request,
HandshakeResponse response
){
request.getHttpSession(); // it causes session "caching" in UpgradeHttpServletRequest
super.modifyHandshake(config, request, response);
}
But it looks like a hack and it isn't so reliable.
And more, @ServerEndpoint(value="/socket.io/", configurator = WebsocketConfigurator.class) on WebsocketTransportConnection does not allow easy override configurator.
It would be great if to make WebsocketTransportConnection non final or create abstract base class with all its functionality to allow easy annotation configuration
Http session isn't available from com.codeminders.socketio.server.Socket with websocket transport at least in Jetty 9.4.7 because of method org.eclipse.jetty.websocket.servlet.UpgradeHttpServletRequest#complete :
As a workaround I have overridden
WebsocketConfigurator#modifyHandshake
:But it looks like a hack and it isn't so reliable. And more,
@ServerEndpoint(value="/socket.io/", configurator = WebsocketConfigurator.class)
onWebsocketTransportConnection
does not allow easy override configurator.