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

HUWWW
TA貢獻1874條經驗 獲得超12個贊
@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
提交
取消