good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
websocket
Commits
e2a32fc7
Unverified
Commit
e2a32fc7
authored
5 years ago
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Compare against existing libraries in README.md
parent
00ca8feb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+29
-0
29 additions, 0 deletions
README.md
ws.go
+1
-0
1 addition, 0 deletions
ws.go
with
30 additions
and
0 deletions
README.md
+
29
−
0
View file @
e2a32fc7
...
...
@@ -13,3 +13,32 @@ This library is in heavy development.
```
bash
go get nhooyr.io/ws
```
## Why
There is no other Go WebSocket library with a clean API.
Comparisons with existing WebSocket libraries below.
### [x/net/websocket](https://godoc.org/golang.org/x/net/websocket)
Unmaintained and the API does not reflect WebSocket semantics.
See https://github.com/golang/go/issues/18152
### [gorilla/websocket](https://github.com/gorilla/websocket)
This package is the community standard but it is very old and over time
has accumulated cruft. There are many ways to do the same thing and the API
overall is just not very clear.
The callback hooks are also confusing. The API for this library has been designed
such that there is only one way to do things and callbacks have been avoided.
Performance sensitive applications should use ws/wscore directly.
## [gobwas/ws](https://github.com/gobwas/ws)
This library has an extremely flexible API but that comes at a cost of usability
and clarity. Its just not clear and simple how to do things in a safe manner.
This diff is collapsed.
Click to expand it.
ws.go
+
1
−
0
View file @
e2a32fc7
...
...
@@ -27,6 +27,7 @@ func (c *Conn) NetConn() net.Conn {
// MessageWriter returns a writer bounded by the context that will write
// a WebSocket data frame of type dataType to the connection.
// Ensure you close the MessageWriter once you have written to entire message.
// Concurrent calls to MessageWriter are ok.
func
(
c
*
Conn
)
MessageWriter
(
ctx
context
.
Context
,
dataType
DataType
)
*
MessageWriter
{
panic
(
"TODO"
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment