Skip to content

Commit c2e0c41

Browse files
committed
Update import path to github.com/coder/websocket
This will create easily solved breakage on updates but I figure it's best to pull the band aid off as early as possible
1 parent bd07a64 commit c2e0c41

37 files changed

+99
-99
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# websocket
22

3-
[![Go Reference](https://pkg.go.dev/badge/nhooyr.io/websocket.svg)](https://pkg.go.dev/nhooyr.io/websocket)
4-
[![Go Coverage](https://img.shields.io/badge/coverage-91%25-success)](https://nhooyr.io/websocket/coverage.html)
3+
[![Go Reference](https://pkg.go.dev/badge/github.com/coder/websocket.svg)](https://pkg.go.dev/github.com/coder/websocket)
4+
[![Go Coverage](https://img.shields.io/badge/coverage-91%25-success)](https://github.com/coder/websocket/coverage.html)
55

66
websocket is a minimal and idiomatic WebSocket library for Go.
77

88
## Install
99

1010
```sh
11-
go get nhooyr.io/websocket
11+
go get github.com/coder/websocket
1212
```
1313

1414
## Highlights
1515

1616
- Minimal and idiomatic API
1717
- First class [context.Context](https://blog.golang.org/context) support
1818
- Fully passes the WebSocket [autobahn-testsuite](https://github.com/crossbario/autobahn-testsuite)
19-
- [Zero dependencies](https://pkg.go.dev/nhooyr.io/websocket?tab=imports)
20-
- JSON helpers in the [wsjson](https://pkg.go.dev/nhooyr.io/websocket/wsjson) subpackage
19+
- [Zero dependencies](https://pkg.go.dev/github.com/coder/websocket?tab=imports)
20+
- JSON helpers in the [wsjson](https://pkg.go.dev/github.com/coder/websocket/wsjson) subpackage
2121
- Zero alloc reads and writes
2222
- Concurrent writes
23-
- [Close handshake](https://pkg.go.dev/nhooyr.io/websocket#Conn.Close)
24-
- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper
25-
- [Ping pong](https://pkg.go.dev/nhooyr.io/websocket#Conn.Ping) API
23+
- [Close handshake](https://pkg.go.dev/github.com/coder/websocket#Conn.Close)
24+
- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper
25+
- [Ping pong](https://pkg.go.dev/github.com/coder/websocket#Conn.Ping) API
2626
- [RFC 7692](https://tools.ietf.org/html/rfc7692) permessage-deflate compression
27-
- [CloseRead](https://pkg.go.dev/nhooyr.io/websocket#Conn.CloseRead) helper for write only connections
28-
- Compile to [Wasm](https://pkg.go.dev/nhooyr.io/websocket#hdr-Wasm)
27+
- [CloseRead](https://pkg.go.dev/github.com/coder/websocket#Conn.CloseRead) helper for write only connections
28+
- Compile to [Wasm](https://pkg.go.dev/github.com/coder/websocket#hdr-Wasm)
2929

3030
## Roadmap
3131

@@ -102,39 +102,39 @@ Advantages of [gorilla/websocket](https://github.com/gorilla/websocket):
102102
- Mature and widely used
103103
- [Prepared writes](https://pkg.go.dev/github.com/gorilla/websocket#PreparedMessage)
104104
- Configurable [buffer sizes](https://pkg.go.dev/github.com/gorilla/websocket#hdr-Buffers)
105-
- 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.
106106
- Will be removed soon with [context.AfterFunc](https://github.com/golang/go/issues/57928). See [#411](https://github.com/nhooyr/websocket/issues/411)
107107

108-
Advantages of nhooyr.io/websocket:
108+
Advantages of github.com/coder/websocket:
109109

110110
- 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.
112-
- [net.Conn](https://pkg.go.dev/nhooyr.io/websocket#NetConn) wrapper
111+
- 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.
112+
- [net.Conn](https://pkg.go.dev/github.com/coder/websocket#NetConn) wrapper
113113
- Zero alloc reads and writes ([gorilla/websocket#535](https://github.com/gorilla/websocket/issues/535))
114114
- Full [context.Context](https://blog.golang.org/context) support
115115
- Dial uses [net/http.Client](https://golang.org/pkg/net/http/#Client)
116116
- Will enable easy HTTP/2 support in the future
117117
- Gorilla writes directly to a net.Conn and so duplicates features of net/http.Client.
118118
- Concurrent writes
119119
- 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
121121
- Gorilla requires registering a pong callback before sending a Ping
122122
- 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
124124
- [1.75x](https://github.com/nhooyr/websocket/releases/tag/v1.7.4) faster WebSocket masking implementation in pure Go
125125
- Gorilla's implementation is slower and uses [unsafe](https://golang.org/pkg/unsafe/).
126126
Soon we'll have assembly and be 3x faster [#326](https://github.com/nhooyr/websocket/pull/326)
127127
- Full [permessage-deflate](https://tools.ietf.org/html/rfc7692) compression extension support
128128
- 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))
130130

131131
#### golang.org/x/net/websocket
132132

133133
[golang.org/x/net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) is deprecated.
134134
See [golang/go/issues/18152](https://github.com/golang/go/issues/18152).
135135

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.
138138

139139
#### gobwas/ws
140140

@@ -143,7 +143,7 @@ in an event driven style for performance. See the author's [blog post](https://m
143143

144144
However it is quite bloated. See https://pkg.go.dev/github.com/gobwas/ws
145145

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.
147147

148148
#### lesismal/nbio
149149

@@ -152,4 +152,4 @@ event driven for performance reasons.
152152

153153
However it is quite bloated. See https://pkg.go.dev/github.com/lesismal/nbio
154154

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.

accept.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"path/filepath"
1818
"strings"
1919

20-
"nhooyr.io/websocket/internal/errd"
20+
"github.com/coder/websocket/internal/errd"
2121
)
2222

2323
// AcceptOptions represents Accept's options.

accept_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"sync"
1414
"testing"
1515

16-
"nhooyr.io/websocket/internal/test/assert"
17-
"nhooyr.io/websocket/internal/test/xrand"
16+
"github.com/coder/websocket/internal/test/assert"
17+
"github.com/coder/websocket/internal/test/xrand"
1818
)
1919

2020
func TestAccept(t *testing.T) {

autobahn_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import (
1717
"testing"
1818
"time"
1919

20-
"nhooyr.io/websocket"
21-
"nhooyr.io/websocket/internal/errd"
22-
"nhooyr.io/websocket/internal/test/assert"
23-
"nhooyr.io/websocket/internal/test/wstest"
24-
"nhooyr.io/websocket/internal/util"
20+
"github.com/coder/websocket"
21+
"github.com/coder/websocket/internal/errd"
22+
"github.com/coder/websocket/internal/test/assert"
23+
"github.com/coder/websocket/internal/test/wstest"
24+
"github.com/coder/websocket/internal/util"
2525
)
2626

2727
var excludedAutobahnCases = []string{

close.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"net"
1212
"time"
1313

14-
"nhooyr.io/websocket/internal/errd"
14+
"github.com/coder/websocket/internal/errd"
1515
)
1616

1717
// StatusCode represents a WebSocket status code.

close_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
"testing"
1111

12-
"nhooyr.io/websocket/internal/test/assert"
12+
"github.com/coder/websocket/internal/test/assert"
1313
)
1414

1515
func TestCloseError(t *testing.T) {

compress_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"strings"
1111
"testing"
1212

13-
"nhooyr.io/websocket/internal/test/assert"
14-
"nhooyr.io/websocket/internal/test/xrand"
13+
"github.com/coder/websocket/internal/test/assert"
14+
"github.com/coder/websocket/internal/test/xrand"
1515
)
1616

1717
func Test_slidingWindow(t *testing.T) {

conn_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import (
1616
"testing"
1717
"time"
1818

19-
"nhooyr.io/websocket"
20-
"nhooyr.io/websocket/internal/errd"
21-
"nhooyr.io/websocket/internal/test/assert"
22-
"nhooyr.io/websocket/internal/test/wstest"
23-
"nhooyr.io/websocket/internal/test/xrand"
24-
"nhooyr.io/websocket/internal/xsync"
25-
"nhooyr.io/websocket/wsjson"
19+
"github.com/coder/websocket"
20+
"github.com/coder/websocket/internal/errd"
21+
"github.com/coder/websocket/internal/test/assert"
22+
"github.com/coder/websocket/internal/test/wstest"
23+
"github.com/coder/websocket/internal/test/xrand"
24+
"github.com/coder/websocket/internal/xsync"
25+
"github.com/coder/websocket/wsjson"
2626
)
2727

2828
func TestConn(t *testing.T) {

dial.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"sync"
1818
"time"
1919

20-
"nhooyr.io/websocket/internal/errd"
20+
"github.com/coder/websocket/internal/errd"
2121
)
2222

2323
// DialOptions represents Dial's options.

dial_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515
"testing"
1616
"time"
1717

18-
"nhooyr.io/websocket"
19-
"nhooyr.io/websocket/internal/test/assert"
20-
"nhooyr.io/websocket/internal/util"
21-
"nhooyr.io/websocket/internal/xsync"
18+
"github.com/coder/websocket"
19+
"github.com/coder/websocket/internal/test/assert"
20+
"github.com/coder/websocket/internal/util"
21+
"github.com/coder/websocket/internal/xsync"
2222
)
2323

2424
func TestBadDials(t *testing.T) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy