diff --git a/README.md b/README.md index 490d99f5..47cc3296 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/accept.go b/accept.go index d3ba3258..bf2ed3c8 100644 --- a/accept.go +++ b/accept.go @@ -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. diff --git a/websocket.go b/websocket.go index 50744326..37719932 100644 --- a/websocket.go +++ b/websocket.go @@ -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 {