docs: client: clarify handshake error conditions#965
Open
WofWca wants to merge 1 commit intogorilla:mainfrom
Open
docs: client: clarify handshake error conditions#965WofWca wants to merge 1 commit intogorilla:mainfrom
WofWca wants to merge 1 commit intogorilla:mainfrom
Conversation
The purpose of this change is to set this behavior in stone, so that, for example, introducing "follow redirects" by default would be a breaking change. The [WebSocket spec](https://www.rfc-editor.org/rfc/rfc6455) actually allows the client to follow redirects: > the server might redirect the client using a 3xx status code (but clients are not required to follow them) I think this library should be explicit about whether it does this. I feel like the existing "...so that callers can handle redirects, authentication, etcetera" is not worded strongly enough. Signed-off-by: WofWca <wofwca@protonmail.com>
scalecode-solutions
referenced
this pull request
in scalecode-solutions/magilla
Apr 24, 2026
Foundation commit for the personal fork. No behavior change beyond
what the Go toolchain and std-lib bumps imply.
Module & toolchain
* Rewrite module path to github.com/scalecode-solutions/websocket
across go.mod, README, examples, and import statements.
* Bump language version from 1.20 -> 1.26 (matches local toolchain).
* Bump golang.org/x/net from v0.26.0 -> v0.53.0, closing the path
flagged by upstream issue #991 (HTTP/2 CVEs in older x/net).
Hygiene (small, mechanical)
* interface{} -> any across compression.go, conn.go, conn_test.go,
and json.go (upstream PR #1000). BufferPool interface signature
changes are source-compatible since any is an alias.
* Fix "best effor" -> "best effort" and "buferred" -> "buffered"
typos in conn.go and server.go (upstream PR #975, carried in
PR #1011).
* Add the missing blank line before the Deprecated: marker on
UnderlyingConn so godoc/linters treat it as deprecated
(upstream PR #998).
* Extend the DialContext godoc to note that non-101 responses
produce an error (upstream PR #965).
Drop pre-1.21 compat cruft
* Delete mask_safe.go and the !appengine build tags. Classic
App Engine required a sandboxed Go runtime without unsafe; it
was retired in 2020 and modern App Engine uses the standard
toolchain.
* Drop legacy `// +build` lines (Go 1.18+ only needs //go:build).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this? (check all applicable)
Description
The purpose of this change is to set this behavior in stone, so that, for example, introducing "follow redirects" by default would be a breaking change. The WebSocket spec actually allows the client to follow redirects:
I think this library should be explicit about whether it does this.
I feel like the existing "...so that callers can handle redirects, authentication, etcetera" is not worded strongly enough.
Background: I'm working on an application that makes connections to arbitrary addresses, so a target WebSocket server might be malicious. Thus I want to limit the scope of what a malicious server can do. For example, ensure that it's not gonna redirect the client to a private address, or to a DDoS target.
Related Tickets & Documents
Added/updated tests?
Run verifications and test
make verifyis passingmake testis passing