netty-socketio icon indicating copy to clipboard operation
netty-socketio copied to clipboard

Getting 404 for /socket-io/?EIO=3&transport=polling&t=NG2FwLh when netty-socketio server and tomcat run on same port

Open sansingh opened this issue 4 years ago • 3 comments

I'm trying to configure a Sprint Boot REST app that uses port 8080 to also use SocketIOServer on port 8080.

if i use another port for SocketIOServer, it works fine.

if i use port 8080, i get a port in use error unless i set the following:

@Bean
public SocketIOServer socketIOServer() {
    com.corundumstudio.socketio.Configuration config =
            new com.corundumstudio.socketio.Configuration();
    config.setHostname(nwtNasaWebsocketServer);
    config.setPort(Integer.parseInt(nwtNasaWebsocketPortString));
    SocketConfig sockConfig = new SocketConfig();
    sockConfig.setReuseAddress(true);
    config.setSocketConfig(sockConfig);
    return new SocketIOServer(config);
}

but then when i try to connect from the socket io client, i get a 404 for below call:

http://localhost:8080/socket-io/?EIO=3&transport=polling&t=NG2FwLh

I see similar issue opened previously https://github.com/mrniko/netty-socketio/issues/545 but no solution hint has been provided. Could someone please help here?

sansingh avatar Aug 18 '20 15:08 sansingh

Any solution for this issue? I want to run my REST endpoints and socketio server on same port

vamsivammu avatar Oct 21 '21 16:10 vamsivammu

You may want to take a look at port unification in underlying netty server.

pablojr avatar Oct 21 '21 17:10 pablojr

Thank you for the quick response. I will check that

vamsivammu avatar Oct 21 '21 17:10 vamsivammu

Hello, has this issue been resolved

XSWClevo avatar Dec 06 '23 07:12 XSWClevo