[ANN] sockjs-go: SockJS server for Go

84 views
Skip to first unread message

juha...@gmail.com

unread,
Mar 3, 2013, 9:06:21 AM3/3/13
to soc...@googlegroups.com
I've written a SockJS server for Go.

https://github.com/fzzy/sockjs-go

It's still experimental, but nervertheless passes 68/72 tests of the sockjs test suite (remaining tests wontfix right now due to issues in Go's websocket package).
There's a trivial chat example included in the examples directory as well.


Sebastian Schuler

unread,
Apr 16, 2013, 2:24:17 PM4/16/13
to soc...@googlegroups.com, juha...@gmail.com
Thanks for your hard work!
Is there any progress to report about the missing tests? Go 1.1 has been released, did they fix the problem with the websocket close upstream?

juha...@gmail.com

unread,
Apr 16, 2013, 9:02:54 PM4/16/13
to soc...@googlegroups.com, juha...@gmail.com
To my knowledge Go 1.1 does not fix any of the issues with websocket.

These are the missing four tests:

(should be trivial to fix on upstream, see http://code.google.com/p/go/issues/detail?id=4588)
test_close (__main__.RawWebsocket) ... FAIL

(test hangs for some reason. haproxy works for me, tough)
test_haproxy (__main__.WebsocketHixie76) ... ERROR

(same error for the two of these:
Exception: 400 {'Sec-WebSocket-Version': '13, 8'} No Transfer-Encoding:chunked nor Content-Length nor Connection:Close!
Not sure how to fix, could be trivial. I think it's an issue on upstream.)
test_firefox_602_connection_header (__main__.WebsocketHybi10) ... ERROR
test_headersSanity (__main__.WebsocketHybi10) ... ERROR

The missing tests are all related to websockets and could probably be fixed by sending patches to upstream.

Also, the google websocket package has two other problems:
1) it does not allow setting maximum message size, http://code.google.com/p/go/issues/detail?id=5082
you may run out of memory, if someone sends you a very big message

2) it does not support PINGs or PONGs. apparently hanged connections may never get garbage collected.
at least according to this guy: https://plus.google.com/101522949595361604155/posts/8n4CSePMwgV

I am aware of this alternative websocket implementation, but its API looks weird to me.
https://github.com/garyburd/go-websocket/

Maybe for now, it's best just to disable websocket with sockjs-go, if you want to do anything semi-serious with it.
Reply all
Reply to author
Forward
0 new messages