Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(911)

Issue 5303096: code review 5303096: websocket: manage subprotocol negotiation in the websoc...

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by jan.newmarch
Modified:
14 years ago
Reviewers:
ukai, adg, golang-dev
CC:
golang-dev
Visibility:
Public.

Description

websocket: manage subprotocol negotiation in the websocket hybi specification The Hybi-17 websocket specification allows subprotocol negotiation between client and server (e.g. the "chat" or "superchat" subprotocols). This change adds a mechanism for server-side choice of a subprotocol from a set offered by a client. A "simple chooser" can select from a list of subprotocols or a custom chooser can be used.

Patch Set 1 #

Patch Set 2 : diff -r 780c85032b17 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 6ed228888a72 https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -48 lines) Patch
M src/pkg/websocket/hixie.go View 1 2 chunks +4 lines, -2 lines 0 comments Download
M src/pkg/websocket/hixie_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/websocket/hybi.go View 1 5 chunks +39 lines, -22 lines 0 comments Download
M src/pkg/websocket/hybi_test.go View 1 8 chunks +79 lines, -9 lines 0 comments Download
M src/pkg/websocket/server.go View 1 2 6 chunks +22 lines, -11 lines 1 comment Download
M src/pkg/websocket/websocket.go View 1 1 chunk +29 lines, -1 line 0 comments Download
M src/pkg/websocket/websocket_test.go View 1 3 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 7
jan.newmarch
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-11-03 08:18:58 UTC) #1
adg
Why would a user of websocket want to do this?
14 years ago (2011-11-03 23:15:05 UTC) #2
adg
Also looping in Ukai who knows this stuff.
14 years ago (2011-11-03 23:16:10 UTC) #3
jan.newmarch
It's part of the current websocket spec that isn't implemented. The idea is that there ...
14 years ago (2011-11-04 03:56:58 UTC) #4
ukai
http://codereview.appspot.com/5303096/diff/5001/src/pkg/websocket/server.go File src/pkg/websocket/server.go (right): http://codereview.appspot.com/5303096/diff/5001/src/pkg/websocket/server.go#newcode42 src/pkg/websocket/server.go:42: call protocolChooser here, and get rid of protocolChooser from ...
14 years ago (2011-11-04 04:04:49 UTC) #5
adg
On 4 November 2011 14:56, Jan Newmarch <jan.newmarch@gmail.com> wrote: > It's part of the current ...
14 years ago (2011-11-04 04:08:03 UTC) #6
jan.newmarch
14 years ago (2011-11-04 04:15:31 UTC) #7
That's okay. I'll keep the code lying around and it can go in if a strong enough use case comes up. On Fri, Nov 4, 2011 at 3:07 PM, Andrew Gerrand <adg@golang.org> wrote: > On 4 November 2011 14:56, Jan Newmarch <jan.newmarch@gmail.com> wrote: >> It's part of the current websocket spec that isn't implemented. The >> idea is that there may be several possible subprotocols that could be >> used between a websocket client and server, and this allows a >> negotiation mechanism beween them. The examples in the spec are a >> "chat" and a "superchat" protocol. I have made an example where the >> data format may be negotiated between JSON and XML. >> >> It's been discussed on golang-nuts under "How can a server negotiate a >> subprotocol in the new websocket package?". Kyle Lemons was the only >> commentator there. > > Thanks for the background. > > It's too early to say how important subprotocols will be and what their > best practices are, so I'm hesitant to include this. It complicates > what is already a fairly complicated interface. > > I'd rather wait until someone has a concrete use for subprotocol > selection before implementing this. It's a challenging but fruitless > game to play catch-up with a spec that changes so frequently. > > Does that sound okay to you? > > Andrew > 
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b