Skip to content

Commit

Permalink
Merge pull request #92 from nhooyr/docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
nhooyr authored Jun 5, 2019
2 parents bf6f475 + 1e92b02 commit d8e872c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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

0 comments on commit d8e872c

Please sign in to comment.