Page MenuHomePhabricator

RCStream: Upgrade server protocol to socket.io v1
Closed, DuplicatePublic

Description

I tried to run the JavaScript example from https://wikitech.wikimedia.org/wiki/RCStream using node.js. It does not work with latest socket.io-client library. The latest one where it works seems to be 0.9.17. The example simply does not output anything on newer versions.

After some debugging it seems that the error is that using HTTPS it fails with 503, and using HTTP it fails with 404.

Event Timeline

Mitar raised the priority of this task from to Needs Triage.
Mitar updated the task description. (Show Details)
Mitar added a project: EventStreams.
Mitar changed Security from none to None.
Mitar subscribed.

Latest socket.io-client is currently 1.2.1. So 0.9.17 is quite old. :-)

We should have a simple rcstream-client npm package that expresses a dependency on a compatible version of socket.io-client.

Krinkle: if I recall correctly, you wrote a node.js implementation of RCStream that was compatible with the latest release of socket.io. Is it time to upgrade?

Krinkle renamed this task from Stream: It does not work with newer version of socket.io-client to RCStream: Upgrade server protocol to socket.io v1.Jan 8 2015, 11:54 AM
Krinkle claimed this task.
Krinkle triaged this task as Low priority.

Lowering priority since there's no expectation that RCStream will work with any protocol version. socket.io has multiple protocol versions and generally a server should only support one.

The v0.9 protocol is by far the most popular at the moment, though that is slowly changing now that at least the reference implementation (socket.io-client) has a v1.0 release. However you can't use that yet. And installing the "latest" version of something isn't a good practice anyway. The correct version is now documented https://wikitech.wikimedia.org/wiki/RCStream#JavaScript. The majority of changes between v0.9 and v1.0 is in the backend. The API surface is largely the same and shouldn't block any particular features.

I do however very much want RCStream to be ahead of the curve and encouraging new software to be written in current versions of socket.io and not old ones. RCStream is currently implemented in Python and uses the gevent-socketio package. That package has not yet implemented support for the socket.io v1.0 protocol, so there's no upgrade available. It's been raised upstream (https://github.com/abourget/gevent-socketio/issues/192) however it seems the project is no longer seeing active maintenance.

Considering RCStream is a fairly small library, I'd recommend taking this opportunity to rewrite it in Node.js using the official socket.io server implementation (which is written in node) in favour of using a port.