Spring loses 'Connection' header when using WebSockets

344 views
Skip to first unread message

Vlad Lubenskiy via StackOverflow

unread,
Apr 15, 2016, 8:34:07 PM4/15/16
to google-appengin...@googlegroups.com

I'm trying out the WebSockets using pure JS and Google App Engine SDK (Jetty Embedded) + Spring, locally.

The problem is Chrome sends correct set of headers in order to make a handshake, but Spring doesn't seem to see 'Connection' header:

Apr 16, 2016 1:51:15 AM org.springframework.web.socket.server.support.DefaultHandshakeHandler handleInvalidConnectHeader
SEVERE: Handshake failed due to invalid Connection header []

Recieved headers

As I said, Chrome sends all of them like it should: Sent headers

How do you think, where have I missed something? I just can't imagine what is going on.

Dummy client-side:

var exampleSocket = new WebSocket("ws://localhost:8080/socket", "protocolOne");
exampleSocket.send("Here's some text that the server is urgently awaiting!");

Dummy config:

<bean id="newMessageHandler" class="com.smth.controller.NewMessageHandler"/>
<websocket:handlers  allowed-origins="http://localhost">
    <websocket:mapping path="/socket" handler="newMessageHandler"/>
</websocket:handlers>


Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/36658800/spring-loses-connection-header-when-using-websockets
Reply all
Reply to author
Forward
0 new messages