參照網(wǎng)上文章寫了springboot+websocket的demo。但是我看到好幾篇文章,他們websocket的端口都不一樣的。這個端口怎么設(shè)置呀?我不知道自己寫的websocket是用什么端口的,不知道怎么去測試。怎么知道這個端口號呢
2 回答

森林海
TA貢獻2011條經(jīng)驗 獲得超2個贊
@Beanfun socketIOServer(): SocketIOServer { val config = com.corundumstudio.socketio.Configuration() config.hostname = "localhost" config.port = 8089 return SocketIOServer(config); }@Beanfun springAnnotationScanner(socketServer: SocketIOServer): SpringAnnotationScanner { return SpringAnnotationScanner(socketServer); }
添加回答
舉報
0/150
提交
取消