SockJS-node, SockJS-client 0.2.0 released

421 views
Skip to first unread message

Marek Majkowski

unread,
Jan 18, 2012, 11:18:25 AM1/18/12
to SockJS
Great news everyone!

SockJS 0.2 is finally released. The biggest change is the new protocol
handshake. This feature should result in drastically faster connection
times for clients using fallback protocols (for example browsers
behind proxies or some antiviruses).

Under the hood we removed a hardcoded 5 seconds timeout and started
using a dynamic timeout based on round trip time between the client
and the server. Please report any problems with this functionality and
feel free to tweak the "rtt" option passed to the SockJS-client
constructor.

If you want to see the new algorithm in action go to our cursor
example and play around:
http://sockjs.popcnt.org/example-cursors.html


Tons of other improvements were made, few require extra attention:

1) SockJS-client API had slightly changed - use `protocols_whitelist`
option instead of passing an array of protocols as a second argument
to SockJS constructor. For example previously you could do:
var sock = new SockJS(url, ['websocket'])
new way:
var sock = new SockJS(url, null,
{protocols_whitelist:['websocket']})

2) SockJS-node supports option `websocket` instead of `disabled_transports`.
3) The deprecated SockJS-node API got removed, use `sockjs.createServer`
instead of `sockjs.Server`.


Other SockJS servers (Lua, Erlang, Tornado, Vert.x) are encouraged to
support SockJS-protocol 0.2. The changes should be quite
straightforward, the new /info url is the most important change. For
details see: http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.2.html

Binary data functionality got pushed back to future release, with a
bit of luck it shouldn't require major changes to the sockjs-protocol
and could be kept as an optional extension.


Have a Socky new year!

Cheers,
Marek


SockJS-client
=============

* The API had changed - use `protocols_whitelist` option instead of
passing an array of protocols as a second argument to SockJS constructor.
* Dropped 'chunking-test' functionality and replace it with 'info'.
* Rewritten protocol-choosing alogirthm, see "utils.detectProtocols" method.
* Use dynamic protocol timeouts based on RTT, not hardcoded 5 seconds
* #34 - Don't ever reuse `session_id`, especially when trying
fallback protocols.
* The test server got moved from SockJS-client to SockJS-node.
* Don't test unicode surrogates - it can't work in some environments.
* XHR/XDR helpers were rewritten, ajax transports were simplified.
* Added a domain check in the iframe to improve security.
* SockJS will now trigger 1002 error if there is a problem during handshake
instead of 2000 error.
* Smoke-throughput test is renamed to smoke-latency.


SockJS-node
===========

* #36, #3 - Replace a custom WebSocket server implementation
with faye-websocket-node.
* Multiple changes to support SockJS-protocol 0.2.
* The session is now closed on network errors immediately
(instead of waiting 5 seconds)
* Raw websocket interface available - to make it easier
to write command line SockJS clients.
* Support '/info' url.
* The test server got moved from SockJS-client to SockJS-node.
* Dropped deprecated Server API (use createServer method instead).
* Option `websocket` is now used instead of `disabled_transports`.

Reply all
Reply to author
Forward
0 new messages