参照网上文章写了springboot+websocket的demo。但是我看到好几篇文章,他们websocket的端口都不一样的。这个端口怎么设置呀?我不知道自己写的websocket是用什么端口的,不知道怎么去测试。怎么知道这个端口号呢
参照网上文章写了springboot+websocket的demo。但是我看到好几篇文章,他们websocket的端口都不一样的。这个端口怎么设置呀?我不知道自己写的websocket是用什么端口的,不知道怎么去测试。怎么知道这个端口号呢
@Bean
fun socketIOServer(): SocketIOServer {
val config = com.corundumstudio.socketio.Configuration()
config.hostname = "localhost"
config.port = 8089
return SocketIOServer(config);
}
@Bean
fun springAnnotationScanner(socketServer: SocketIOServer): SpringAnnotationScanner {
return SpringAnnotationScanner(socketServer);
}
15 回答8.4k 阅读
8 回答6.2k 阅读
3 回答3.6k 阅读✓ 已解决
1 回答4k 阅读✓ 已解决
3 回答2.6k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
2 回答3.1k 阅读
和你springboot项目的端口一致