随笔分类 - Socket
摘要:请求体:Request Handshake Details Request URL: http://localhost:9100/imserver/10 Request Method: GET Status Code: 101 //请求头信息 Request Headers Sec-WebSocke
阅读全文
摘要:问题记录:本地socket测试无误后部署发现 WebSocket connection to "xxx/xxx" failed 解决方案: 在nginx.conf的http模块添加如下内容 map $http_upgrade $connection_upgrade { default upgrade
阅读全文
摘要:多端点服务 可通过ServerEndpointExporter.getInetSocketAddressSet()获取所有端点的地址 当地址不同时(即host不同或port不同),使用不同的ServerBootstrap实例 当地址相同,路径(path)不同时,使用同一个ServerBootstra
阅读全文
摘要:注解说明 @ServerEndpoint 当ServerEndpointExporter类通过Spring配置进行声明并被使用,它将会去扫描带有@ServerEndpoint注解的类 被注解的类将被注册成为一个WebSocket端点 所有的配置项都在这个注解的属性中 ( 如:@ServerEndpo
阅读全文
摘要:SpringBoot+WebSocket对每个客户端连接都会创建一个WebSocketServer(@ServerEndpoint注解对应的)对象,Bean的注入操作会被直接略过,因而手动注入一个全局变量 @ServerEndpoint("/im/{userId}/{toUserId}") @Res
阅读全文