You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- No extra goroutine per connection to support cancellation with context.Context. This costs nhooyr.io/websocket 2 KB of memory per connection.
105
+
- No extra goroutine per connection to support cancellation with context.Context. This costs github.com/coder/websocket 2 KB of memory per connection.
106
106
- Will be removed soon with [context.AfterFunc](https://github.com/golang/go/issues/57928). See [#411](https://github.com/nhooyr/websocket/issues/411)
107
107
108
-
Advantages of nhooyr.io/websocket:
108
+
Advantages of github.com/coder/websocket:
109
109
110
110
- Minimal and idiomatic API
111
-
- Compare godoc of [nhooyr.io/websocket](https://pkg.go.dev/nhooyr.io/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side.
- Compare godoc of [github.com/coder/websocket](https://pkg.go.dev/github.com/coder/websocket) with [gorilla/websocket](https://pkg.go.dev/github.com/gorilla/websocket) side by side.
- Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client.
118
118
- Concurrent writes
119
119
- Close handshake ([gorilla/websocket#448](https://github.com/gorilla/websocket/issues/448))
120
-
- Idiomatic [ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API
120
+
- Idiomatic [ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API
121
121
- Gorilla requires registering a pong callback before sending a Ping
122
122
- Can target Wasm ([gorilla/websocket#432](https://github.com/gorilla/websocket/issues/432))
123
-
- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) subpackage
123
+
- Transparent message buffer reuse with [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage
124
124
-[1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go
125
125
- Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/).
126
126
Soon we'll have assembly and be 3x faster [#326](https://github.com/nhooyr/websocket/pull/326)
127
127
- Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support
128
128
- Gorilla only supports no context takeover mode
129
-
-[CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper for write only connections ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492))
129
+
-[CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections ([gorilla/websocket#492](https://github.com/gorilla/websocket/issues/492))
130
130
131
131
#### golang.org/x/net/websocket
132
132
133
133
[golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated.
134
134
See [golang/go/issues/18152](https://github.com/golang/go/issues/18152).
135
135
136
-
The [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) can help in transitioning
137
-
to nhooyr.io/websocket.
136
+
The [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) can help in transitioning
137
+
to github.com/coder/websocket.
138
138
139
139
#### gobwas/ws
140
140
@@ -143,7 +143,7 @@ in an event driven style for performance. See the author's [blog post](https://m
143
143
144
144
However it is quite bloated. See https://pkg.go.dev/github.com/gobwas/ws
145
145
146
-
When writing idiomatic Go, nhooyr.io/websocket will be faster and easier to use.
146
+
When writing idiomatic Go, github.com/coder/websocket will be faster and easier to use.
147
147
148
148
#### lesismal/nbio
149
149
@@ -152,4 +152,4 @@ event driven for performance reasons.
152
152
153
153
However it is quite bloated. See https://pkg.go.dev/github.com/lesismal/nbio
154
154
155
-
When writing idiomatic Go, nhooyr.io/websocket will be faster and easier to use.
155
+
When writing idiomatic Go, github.com/coder/websocket will be faster and easier to use.
0 commit comments