Skip to content

Commit 4fb9712

Browse files
committed
Document why publish endpoint and not sending messages over WebSocket
See #174 (comment)
1 parent b2f1496 commit 4fb9712

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/chat/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ Visit the printed URL to submit and view broadcasted messages in a browser.
1717
The frontend is contained in `index.html`, `index.js` and `index.css`. It sets up the
1818
DOM with a scrollable div at the top that is populated with new messages as they are broadcast.
1919
At the bottom it adds a form to submit messages.
20+
2021
The messages are received via the WebSocket `/subscribe` endpoint and published via
21-
the HTTP POST `/publish` endpoint.
22+
the HTTP POST `/publish` endpoint. The reason for not publishing messages over the WebSocket
23+
is so that you can easily publish a message with curl.
2224

2325
The server portion is `main.go` and `chat.go` and implements serving the static frontend
2426
assets, the `/subscribe` WebSocket endpoint and the HTTP POST `/publish` endpoint.

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