Skip to content

Commit 1025138

Browse files
committed
Add code snippet for EnableCompression in doc.go, change EnableWriteCompression()'s parameter to false since enableWriteCompression is true by default.
1 parent 4e4c8d0 commit 1025138

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

doc.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,20 @@
156156
// Per message compression extensions (RFC 7692) are experimentally supported
157157
// by this package in a limited capacity. Setting the EnableCompression option
158158
// to true in Dialer or Upgrader will attempt to negotiate per message deflate
159-
// support. If compression was successfully negotiated with the connection's
160-
// peer, any message received in compressed form will be automatically
161-
// decompressed. All Read methods will return uncompressed bytes.
159+
// support.
160+
//
161+
// var upgrader = websocket.Upgrader{
162+
// EnableCompression: true,
163+
// }
164+
//
165+
// If compression was successfully negotiated with the connection's peer, any
166+
// message received in compressed form will be automatically decompressed.
167+
// All Read methods will return uncompressed bytes.
162168
//
163169
// Per message compression of messages written to a connection can be enabled
164170
// or disabled by calling the corresponding Conn method:
165171
//
166-
// conn.EnableWriteCompression(true)
172+
// conn.EnableWriteCompression(false)
167173
//
168174
// Currently this package does not support compression with "context takeover".
169175
// This means that messages must be compressed and decompressed in isolation,

0 commit comments

Comments
 (0)