Skip to content

Commit

Permalink
Merge pull request #210 from nobuf/nobuf/update-doc-about-compression
Browse files Browse the repository at this point in the history
Add code snippet for EnableCompression in doc.go
  • Loading branch information
garyburd authored Jan 26, 2017
2 parents 4e4c8d0 + 1025138 commit c36f2fe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,20 @@
// Per message compression extensions (RFC 7692) are experimentally supported
// by this package in a limited capacity. Setting the EnableCompression option
// to true in Dialer or Upgrader will attempt to negotiate per message deflate
// support. If compression was successfully negotiated with the connection's
// peer, any message received in compressed form will be automatically
// decompressed. All Read methods will return uncompressed bytes.
// support.
//
// var upgrader = websocket.Upgrader{
// EnableCompression: true,
// }
//
// If compression was successfully negotiated with the connection's peer, any
// message received in compressed form will be automatically decompressed.
// All Read methods will return uncompressed bytes.
//
// Per message compression of messages written to a connection can be enabled
// or disabled by calling the corresponding Conn method:
//
// conn.EnableWriteCompression(true)
// conn.EnableWriteCompression(false)
//
// Currently this package does not support compression with "context takeover".
// This means that messages must be compressed and decompressed in isolation,
Expand Down

0 comments on commit c36f2fe

Please sign in to comment.