【发布时间】:2017-08-12 10:50:03
【问题描述】:
我在连接套接字时遇到问题。
这是我在浏览器上遇到的错误。 socket error
这是我的弹簧插座配置
@EnableWebSocketMessageBroker
public class ChatSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/queue", "/topic");
config.setApplicationDestinationPrefixes("/chat");
}
/**
* Register the endpoint where the socket will call to connect
*/
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/chat-connect").setAllowedOrigins("*").withSockJS();
}
我正在使用 sockjs-client v1.0.3,在 tomcat 8 中运行 java 应用程序,在 aws 上运行 linux ec2。
关于如何解决这个问题的任何帮助?
已编辑
在服务器上,我看到的唯一日志是“Handshake failed due to invalid Upgrade header: null”
【问题讨论】: