Links2004 / arduinoWebSockets

arduinoWebSockets
GNU Lesser General Public License v2.1
1.87k stars 553 forks source link

Unrecognized token 'CONNECT' #415

Open gertvermeersch opened 5 years ago

gertvermeersch commented 5 years ago

When connecting to a standard STOMP Broker using Spring Boot:

com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'CONNECT': was expecting ('true', 'false' or 'null')
 at [Source: (String)"CONNECT
accept-version:1.1,1.0
heart-beat:10000,10000

The debug from the ESP8266:

[WSc] Connected to url: /homecontrol/130/717372/websocket
[WSc] get text: o
[WSc] get text: c[1007,""]
[WSc] Disconnected!
[WSc] Connected to url: /homecontrol/130/717372/websocket
[WSc] get text: o

I just created a simple endpoint and a topic / queue:

    @Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        config.enableSimpleBroker("/topic", "/queue");
        config.setApplicationDestinationPrefixes("/app");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/homecontrol").withSockJS();
    }

Using a simple Javascript page with SockJS works though... Any thoughts?

gertvermeersch commented 5 years ago

I want to add that it does work without using SockJS

/homecontrol/websocket
Links2004 commented 5 years ago

I dont have a STOMP setup, but may @mgbckr can help you.

mgbckr commented 5 years ago

Hi, it's been a while and my test environment is not set up. I won't be able to help you there at the moment. Sorry about that! :(