Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,11 @@ about performant WebSocket servers.
If you want a library that gives you absolute control over everything, this is the library,
but for most users, the API provided by nhooyr/websocket will fit better as it is nearly just
as performant but much easier to use correctly and idiomatic.

## Users

This is a list of companies or projects that use this library.

- [Coder](https://github.com/cdr)

If your company or project is using this library, please feel free to open a PR to amend the list.
3 changes: 2 additions & 1 deletion accept.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) error {
// the connection to a WebSocket.
//
// Accept will reject the handshake if the Origin domain is not the same as the Host unless
// the InsecureSkipVerify option is set.
// the InsecureSkipVerify option is set. In other words, by default it does not allow
// cross origin requests.
//
// The returned connection will be bound by r.Context(). Use conn.Context() to change
// the bounding context.
Expand Down
5 changes: 5 additions & 0 deletions websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ func (c *Conn) handleControl(h header) {
// be read if you do not read the message from the connection.
//
// Only one Reader may be open at a time.
//
// If you need a separate timeout on the Reader call and then the message
// Read, use time.AfterFunc to cancel the context passed in early.
// See https://github.com/nhooyr/websocket/issues/87#issue-451703332
// Most users should not need this.
func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {
typ, r, err := c.reader(ctx)
if err != nil {
Expand Down