muthesius/WebSocketP5 — Issue #1: Fail on chrome 15.0.874.106 but works on safari 5.1.1 (osx)
Author: kalanda
Created: 2011-10-28 12:56:26+00:00
State: open

Hi there,

First, I love this library. I looking for something like this a long time ago ;)
I would like to use it to develop a new version of my project https://github.com/kalanda/serial2socket-proxy to communicate an arduino board in the serial port to a web application via websockets.

Testing the library, it works perfectly on safari 5 (osx) but in Chrome I get a NullPointerException in the Processing console:

Server done
java.lang.NullPointerException: value
at org.jboss.netty.handler.codec.http.HttpCodecUtil.validateHeaderValue(HttpCodecUtil.java:102)
at org.jboss.netty.handler.codec.http.HttpHeaders.addHeader(HttpHeaders.java:797)
at org.jboss.netty.handler.codec.http.DefaultHttpMessage.addHeader(DefaultHttpMessage.java:49)
at org.webbitserver.netty.NettyWebSocketChannelHandler.upgradeResponseOldSkool(Unknown Source)
at org.webbitserver.netty.NettyWebSocketChannelHandler.prepareConnection(Unknown Source)
at org.webbitserver.netty.NettyWebSocketChannelHandler.(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.upgradeToWebSocketConnection(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.upgradeToWebSocketConnection(Unknown Source)
at org.webbitserver.handler.HttpToWebSocketHandler.handleHttpRequest(Unknown Source)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.nextHandler(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.nextHandler(Unknown Source)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.nextHandler(Unknown Source)
at org.webbitserver.netty.NettyHttpControl.nextHandler(Unknown Source)
at org.webbitserver.netty.NettyHttpChannelHandler$1.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

Looking for possible reasons, I found that the websocket protocol was changed because a security bug was found. The webbitserver 0.2.0 now supports this new specification:
http://aslakhellesoy.com/post/8662017748/webbit-0-2-0-with-hybi-10-support

Can you update the code of this lovely library to use the new release of webbit?

Thanks a lot in advance.