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

Issue 8731044: code review 8731044: go.net/websocket: allow server configurable

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by ukai
Modified:
9 years, 1 month ago
CC:
golang-dev, mikio, crobin
Visibility:
Public.

Description

go.net/websocket: allow server configurable Add websocket.Server to configure WebSocket server handler. - Config.Header is additional headers to send, so you can use it to send cookies or so. To read cookies, you can use Conn.Request().Header. - factor out Handshake. You can set func to check origin, subprotocol etc. Handler checks origin by default. Fixes issue 4198. Fixes issue 5178.

Patch Set 1 #

Patch Set 2 : diff -r 4e0dc83f5a85 https://code.google.com/p/go.net #

Patch Set 3 : diff -r 4e0dc83f5a85 https://code.google.com/p/go.net #

Total comments: 6

Patch Set 4 : diff -r 9c2295dac419 https://code.google.com/p/go.net #

Patch Set 5 : diff -r 9c2295dac419 https://code.google.com/p/go.net #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -25 lines) Patch
M websocket/client.go View 1 2 chunks +2 lines, -0 lines 0 comments Download
M websocket/hybi.go View 1 2 3 5 chunks +39 lines, -10 lines 1 comment Download
M websocket/hybi_test.go View 1 1 chunk +65 lines, -0 lines 0 comments Download
M websocket/server.go View 1 2 3 4 chunks +55 lines, -10 lines 1 comment Download
M websocket/websocket.go View 1 1 chunk +3 lines, -0 lines 0 comments Download
M websocket/websocket_test.go View 1 3 chunks +58 lines, -5 lines 0 comments Download

Messages

Total messages: 19
ukai
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.net
11 years ago (2013-04-13 05:29:37 UTC) #1
mikio
https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go File websocket/hybi.go (right): https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go#newcode531 websocket/hybi.go:531: func GetOrigin(config *Config, req *http.Request) (*url.URL, error) { just ...
11 years ago (2013-04-20 06:53:31 UTC) #2
crobin
https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go File websocket/hybi.go (right): https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go#newcode531 websocket/hybi.go:531: func GetOrigin(config *Config, req *http.Request) (*url.URL, error) { Also ...
11 years ago (2013-04-23 14:27:58 UTC) #3
ukai
https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go File websocket/hybi.go (right): https://codereview.appspot.com/8731044/diff/5001/websocket/hybi.go#newcode531 websocket/hybi.go:531: func GetOrigin(config *Config, req *http.Request) (*url.URL, error) { On ...
10 years, 12 months ago (2013-05-01 07:31:19 UTC) #4
ukai
Hello golang-dev@googlegroups.com, mikioh.mikioh@gmail.com, crobin@nekoo.com (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 12 months ago (2013-05-01 07:31:28 UTC) #5
mikio
LGTM sorry for the late response. not sure IssueTracker can handle multiple issue numbers. perhaps ...
10 years, 11 months ago (2013-05-10 10:39:10 UTC) #6
ukai
On 2013/05/10 10:39:10, mikio wrote: > LGTM Thanks! > sorry for the late response. > ...
10 years, 11 months ago (2013-05-10 13:53:07 UTC) #7
mikio
*** Submitted as https://code.google.com/p/go/source/detail?r=1e65ca1b2499&repo=net *** go.net/websocket: allow server configurable Add websocket.Server to configure WebSocket server ...
10 years, 11 months ago (2013-05-12 04:50:18 UTC) #8
everton.marques
I think this commit affected javascript websocket client code running in Google Chrome. My javascript ...
10 years, 11 months ago (2013-05-13 20:56:22 UTC) #9
johan.bilien
On 2013/05/13 20:56:22, everton.marques wrote: > I think this commit affected javascript websocket client code ...
10 years, 11 months ago (2013-05-14 01:15:53 UTC) #10
rog
This CL broke some of our existing code. I wonder if the default behaviour should ...
10 years, 11 months ago (2013-05-15 14:38:30 UTC) #11
mikio
On Wed, May 15, 2013 at 11:38 PM, roger peppe <rogpeppe@gmail.com> wrote: > This CL ...
10 years, 11 months ago (2013-05-15 15:10:27 UTC) #12
rog
What security issues does parsing the Origin header address? On May 15, 2013 4:10 PM, ...
10 years, 11 months ago (2013-05-15 18:14:15 UTC) #13
mikio
On Thu, May 16, 2013 at 3:14 AM, roger peppe <rogpeppe@gmail.com> wrote: > What security ...
10 years, 11 months ago (2013-05-16 01:12:57 UTC) #14
ukai
On Wed, May 15, 2013 at 11:38 PM, roger peppe <rogpeppe@gmail.com> wrote: > This CL ...
10 years, 11 months ago (2013-05-16 02:23:43 UTC) #15
shurcooL
I spotted a minor issue with the comment formatting, I'd like to point it out. ...
9 years, 1 month ago (2015-03-01 23:15:38 UTC) #16
songofacandy
https://codereview.appspot.com/8731044/diff/16001/websocket/hybi.go File websocket/hybi.go (right): https://codereview.appspot.com/8731044/diff/16001/websocket/hybi.go#newcode540 websocket/hybi.go:540: if origin == "null" { RFC 6455 1.3 says ...
9 years, 1 month ago (2015-03-02 01:19:47 UTC) #17
mikio
thanks. in next time, please open a new issue. On Mon, Mar 2, 2015 at ...
9 years, 1 month ago (2015-03-07 09:52:39 UTC) #18
mikio
9 years, 1 month ago (2015-03-07 09:53:23 UTC) #19
thanks, filed golang.org/issue/10102. in next time, please open a new issue.

On Mon, Mar 2, 2015 at 10:19 AM,  <songofacandy@gmail.com> wrote:
>
> https://codereview.appspot.com/8731044/diff/16001/websocket/hybi.go
> File websocket/hybi.go (right):
>
>
https://codereview.appspot.com/8731044/diff/16001/websocket/hybi.go#newcode540
> websocket/hybi.go:540: if origin == "null" {
> RFC 6455 1.3 says "for non-browser clients, this header field may be
> sent if..."
> So I think "" should be nil origin, too.
>
> https://codereview.appspot.com/8731044/
Sign in to reply to this message.

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