Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by jan.newmarch
Modified:
14 years, 2 months ago
Reviewers:
ukai, adg, golang-dev
CC:
golang-dev
Visibility:
Public.
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
Created: 14 years, 2 months ago
Download [raw] [tar.bz2]
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
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, 2 months ago (2011年11月03日 08:18:58 UTC) #1
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),
I'd like you to review this change to
https://go.googlecode.com/hg/ 
Sign in to reply to this message.
adg
Why would a user of websocket want to do this?
14 years, 2 months ago (2011年11月03日 23:15:05 UTC) #2
Why would a user of websocket want to do this?
Sign in to reply to this message.
adg
Also looping in Ukai who knows this stuff.
14 years, 2 months ago (2011年11月03日 23:16:10 UTC) #3
Also looping in Ukai who knows this stuff.
Sign in to reply to this message.
jan.newmarch
It's part of the current websocket spec that isn't implemented. The idea is that there ...
14 years, 2 months ago (2011年11月04日 03:56:58 UTC) #4
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.
On Fri, Nov 4, 2011 at 10:15 AM, <adg@golang.org> wrote:
> Why would a user of websocket want to do this?
>
> http://codereview.appspot.com/5303096/
>
Sign in to reply to this message.
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, 2 months ago (2011年11月04日 04:04:49 UTC) #5
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#n...
src/pkg/websocket/server.go:42: 
call protocolChooser here, and get rid of protocolChooser from ReadHandshake?
config.Protocol, err := protocolChooser(c.Protocol)
if err != nil {
 ...
}
Or, it might be better to check websocket.Config is acceptable, so that server
implementation could check origin, extensions or others.
Sign in to reply to this message.
adg
On 4 November 2011 14:56, Jan Newmarch <jan.newmarch@gmail.com> wrote: > It's part of the current ...
14 years, 2 months ago (2011年11月04日 04:08:03 UTC) #6
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.
jan.newmarch
That's okay. I'll keep the code lying around and it can go in if a ...
14 years, 2 months 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
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /