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
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
nhooyr
websocket
Commits
5e8fc375
Unverified
Commit
5e8fc375
authored
Apr 15, 2020
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Document why publish endpoint and not sending messages over WebSocket
See
https://github.com/nhooyr/websocket/issues/174#issuecomment-613403182
parent
181f9432
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/chat/README.md
+3
-1
3 additions, 1 deletion
examples/chat/README.md
with
3 additions
and
1 deletion
examples/chat/README.md
+
3
−
1
View file @
5e8fc375
...
...
@@ -17,8 +17,10 @@ Visit the printed URL to submit and view broadcasted messages in a browser.
The frontend is contained in
`index.html`
,
`index.js`
and
`index.css`
. It sets up the
DOM with a scrollable div at the top that is populated with new messages as they are broadcast.
At the bottom it adds a form to submit messages.
The messages are received via the WebSocket
`/subscribe`
endpoint and published via
the HTTP POST
`/publish`
endpoint.
the HTTP POST
`/publish`
endpoint. The reason for not publishing messages over the WebSocket
is so that you can easily publish a message with curl.
The server portion is
`main.go`
and
`chat.go`
and implements serving the static frontend
assets, the
`/subscribe`
WebSocket endpoint and the HTTP POST
`/publish`
endpoint.
...
...
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