Add sub-protocol support
As a WebSocket emulation layer, it makes sense to support sub-protocols in SockJS. The sockjs-client could have a "protocols" option added with the value passed to the server either through the W3C WebSocket constructor or by setting the Sec-WebSocket-Protocol header.
Servers can then choose to add support by checking the Sec-WebSocket-Protocol header.
:+1: yes, that would be a nice addition
+1!
When will this issue be fixed?
Once people stop commenting and start contributing.
There are 7 open PRs, some of them hanging since 2013. Seeing this picture one might ask whether the project is dead.
@sshcherbakov Yes, lets completely ignore the fact that @brycekahle has been had at work rewriting the client since he took over the project and posted various of updates on issues stating that a new release will come once the refactor is done.
The health of a project cannot be determined by the amount of open pull requests and issues. With that same mindset you would also consider joyent/node to be dead as it has 216 open pull requests and 710 issues. Where the oldest pull request is from Mar 10, 2012.
Sorry, didn't check the recent closed PR activity. It looks definitely better than half a year ago.
Since this needs to support more transports than just Websockets, we can't use the WS specific headers. I think the approach taken in #139 is better, by adding it to the info response.
I'm going to schedule this for 1.1 given how much work it will probably be.
This would be a good fit for 1.0 IMO especially now that #65 is addressed. SockJS is very much focused on being a transport so it makes sense to have some sub-protocol negotiation support.
@brycekahle Let me know if there is anything I can help out with on this issue.
This would require server work and changes to the protocol. Right now 1.0 is compatible with the existing protocol, so I don't want to delay 1.0 even further with this work.
@brycekahle Sounds good and I'd be happy to take a stab at adding this for 1.x.
does sockjs support sub-protocols now ?
@allbutone This issue is still open, so no.