Skip to content

Commit d8e872c

Browse files
authored
Merge pull request #92 from nhooyr/docs
Improve docs
2 parents bf6f475 + 1e92b02 commit d8e872c

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,11 @@ about performant WebSocket servers.
165165
If you want a library that gives you absolute control over everything, this is the library,
166166
but for most users, the API provided by nhooyr/websocket will fit better as it is nearly just
167167
as performant but much easier to use correctly and idiomatic.
168+
169+
## Users
170+
171+
This is a list of companies or projects that use this library.
172+
173+
- [Coder](https://github.com/cdr)
174+
175+
If your company or project is using this library, please feel free to open a PR to amend the list.

accept.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) error {
7979
// the connection to a WebSocket.
8080
//
8181
// Accept will reject the handshake if the Origin domain is not the same as the Host unless
82-
// the InsecureSkipVerify option is set.
82+
// the InsecureSkipVerify option is set. In other words, by default it does not allow
83+
// cross origin requests.
8384
//
8485
// The returned connection will be bound by r.Context(). Use conn.Context() to change
8586
// the bounding context.

websocket.go

+5
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ func (c *Conn) handleControl(h header) {
342342
// be read if you do not read the message from the connection.
343343
//
344344
// Only one Reader may be open at a time.
345+
//
346+
// If you need a separate timeout on the Reader call and then the message
347+
// Read, use time.AfterFunc to cancel the context passed in early.
348+
// See https://github.com/nhooyr/websocket/issues/87#issue-451703332
349+
// Most users should not need this.
345350
func (c *Conn) Reader(ctx context.Context) (MessageType, io.Reader, error) {
346351
typ, r, err := c.reader(ctx)
347352
if err != nil {

0 commit comments

Comments
 (0)