Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http session isn't available from com.codeminders.socketio.server.Socket with websocket transport at least in Jetty 9.4.7 #22

Open
Geminist opened this issue Oct 2, 2019 · 1 comment

Comments

@Geminist
Copy link

Geminist commented Oct 2, 2019

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.

@Geminist
Copy link
Author

Geminist commented Oct 3, 2019

It would be great if to make WebsocketTransportConnection non final or create abstract base class with all its functionality to allow easy annotation configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant