Skip to main content

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @EnableWebSocketMessageBroker public class ChatSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {

@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();  } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

EDITED

On server, THe only log I see is "Handshake failed due to invalid Upgrade header: null"

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @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(); } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

EDITED

On server, THe only log I see is "Handshake failed due to invalid Upgrade header: null"

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

@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();  } 

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

EDITED

On server, THe only log I see is "Handshake failed due to invalid Upgrade header: null"

added 105 characters in body
Source Link

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @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(); } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

EDITED

On server, THe only log I see is "Handshake failed due to invalid Upgrade header: null"

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @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(); } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @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(); } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?

EDITED

On server, THe only log I see is "Handshake failed due to invalid Upgrade header: null"

Source Link

Spring + WebSocket Error 400

I'm having problems to connect with socket.

This is the error i'm getting on browser. socket error

This is my spring socket config

` @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(); } 

`

I'm using sockjs-client v1.0.3, running the java application in a tomcat 8, linux ec2 on aws.

Any help on how to solve this problem?