WebSocket problem

427 views
Skip to first unread message

Ned

unread,
Jan 5, 2012, 3:12:45 PM1/5/12
to play-framework
My Play! application opens up a websocket as follows:

WS /activationServer ActivationServer.serve()

I have a websocket client written in Java using Jetty-7.6.0.RC2. When
the client tries to connect to "ws://localhost:9000/activationServer",
my client gets "Bad response status 426 Upgrade Required".

So, I setup sftp on port 9443 in my Play! application (got certs and
everything). Not sure why I was getting the upgrade request, since
I'm connecting to "ws" and not "wss", but whatever, I wanted to move
to "wss" eventually anyway.

Now, I try to connect to wss, "wss://localhost:9000/activationServer",
and I get

WARN:oeji.nio:javax.net.ssl.SSLException: Inbound closed before
receiving peer's close_notify: possible truncation attack?

So far, the Play! app doesn't print anything about the websockets at
all.

Now, I change the port the client is trying to connect to to 9443,
"wss://localhost:9443/activationServer", and I get a simple timeout on
the client, and nothing in Play. But, if try to connect to Play
before the application has initialized (before I load the homepage
over regular http), then Play spits out this error:

java.lang.IllegalArgumentException: unsupported message type: class
org.jboss.netty.handler.codec.http.DefaultHttpResponse
at
org.jboss.netty.channel.socket.nio.SocketSendBufferPool.acquire(SocketSendBufferPool.java:
55)
at
org.jboss.netty.channel.socket.nio.NioWorker.write0(NioWorker.java:
461)
at
org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:
388)
at
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:
137)
at
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:
76)
at
org.jboss.netty.handler.ssl.SslHandler.handleDownstream(SslHandler.ja
va:421)

etc...


I'm totally stumped... Any hints or suggestions?

nico

unread,
Jan 13, 2012, 3:43:40 PM1/13/12
to play-fr...@googlegroups.com

nico

unread,
Jan 18, 2012, 10:56:44 AM1/18/12
to play-fr...@googlegroups.com
I made a Pull Request to submit a patch : https://github.com/playframework/play/pull/438

It should also solve your Jetty issue ( "Bad response status 426 Upgrade Required").
Reply all
Reply to author
Forward
0 new messages