netty-socketio
netty-socketio copied to clipboard
SocketIOServer with Spring Boot REST all on port 8080?
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:
and on the server
Looking up Handler for path socket.io Did not find Handler for path /socket.io/
when spring boot application running ,you need:
@autowaried private SocketIOServer socketIoServer;
SocketIOServer.start();
@lilaizhencn 这个方法行不通。
@lilaizhencn 这个方法行不通。
那种需要单独给socketIoServer配置一个端口。
Hi @datumgeek did you get solution for running tomcat and Netty-socketio on same port. I am having the same 404 issue. Thanks!