Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/websocket: add runnable versions of examples mentioned in Server.Handshake documentation #32866

Open
msoedov opened this issue Jul 1, 2019 · 3 comments · May be fixed by golang/net#50

Comments

@msoedov
Copy link
Contributor

commented Jul 1, 2019

https://godoc.org/golang.org/x/net/websocket there is missing example for redefining your own check origin callback or even disabling the existing one

@gopherbot gopherbot added this to the Unreleased milestone Jul 1, 2019

@msoedov msoedov changed the title x/net/websocket missing doc example for origin check function x/net/websocket: missing doc example for origin check function Jul 1, 2019

@bcmills bcmills changed the title x/net/websocket: missing doc example for origin check function x/net/websocket: add runnable versions of examples mentioned in (*Server).Handshake documentation Jul 1, 2019

@bcmills bcmills changed the title x/net/websocket: add runnable versions of examples mentioned in (*Server).Handshake documentation x/net/websocket: add runnable versions of examples mentioned in Server.Handshake documentation Jul 1, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

Note the current comment on Server.Handshake:

// Handshake is an optional function in WebSocket handshake.
// For example, you can check, or don't check Origin header.
// Another example, you can select config.Protocol.

Since both of those examples are mentioned explicitly, they should probably be illustrated more complete in runnable (and testable!) examples.

@tomocy

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

I would like to handle it. @bcmills

@gopherbot

This comment has been minimized.

Copy link

commented Aug 19, 2019

Change https://golang.org/cl/190819 mentions this issue: x/net/websocket: add example of (*Server).Handshake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.