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 · 4 comments
Labels
Documentation Issues describing a change to documentation. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@msoedov
Copy link
Contributor

msoedov 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 added the Documentation Issues describing a change to documentation. label 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 added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels 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
Copy link
Contributor

bcmills 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
Copy link
Contributor

tomocy commented Jul 9, 2019

I would like to handle it. @bcmills

@gopherbot
Copy link
Contributor

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

tomocy added a commit to tomocy/go-net that referenced this issue Sep 3, 2024
This commit introduces an example demonstrating
the use of (*Server).Handshake with custom validation.

Fixes golang/go#32866
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/609056 mentions this issue: websocket: add example of (*Server).Handshake

tomocy added a commit to tomocy/go-net that referenced this issue Sep 4, 2024
This commit introduces an example demonstrating
the use of (*Server).Handshake with custom validation.

Fixes golang/go#32866

Change-Id: Id6c25f1043b12fafd93161b3182bf9063b5f307b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues describing a change to documentation. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants