sockjs-client icon indicating copy to clipboard operation
sockjs-client copied to clipboard

Add sub-protocol support

Open rstoyanchev opened this issue 13 years ago • 14 comments

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.

rstoyanchev avatar Jul 27 '13 17:07 rstoyanchev

:+1: yes, that would be a nice addition

matzew avatar Aug 05 '13 14:08 matzew

+1!

sshcherbakov avatar Aug 19 '13 09:08 sshcherbakov

When will this issue be fixed?

ghost avatar Aug 27 '14 07:08 ghost

Once people stop commenting and start contributing.

radicans avatar Aug 27 '14 07:08 radicans

There are 7 open PRs, some of them hanging since 2013. Seeing this picture one might ask whether the project is dead.

sshcherbakov avatar Aug 27 '14 07:08 sshcherbakov

@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.

radicans avatar Aug 27 '14 07:08 radicans

Sorry, didn't check the recent closed PR activity. It looks definitely better than half a year ago.

sshcherbakov avatar Aug 27 '14 07:08 sshcherbakov

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.

brycekahle avatar Oct 20 '14 19:10 brycekahle

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.

rstoyanchev avatar Oct 21 '14 12:10 rstoyanchev

@brycekahle Let me know if there is anything I can help out with on this issue.

danbev avatar Oct 21 '14 12:10 danbev

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 avatar Oct 21 '14 15:10 brycekahle

@brycekahle Sounds good and I'd be happy to take a stab at adding this for 1.x.

danbev avatar Oct 23 '14 05:10 danbev

does sockjs support sub-protocols now ?

allbutone avatar Apr 03 '18 08:04 allbutone

@allbutone This issue is still open, so no.

brycekahle avatar Apr 06 '18 17:04 brycekahle