-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3d73ed
commit cf76367
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Testing with WebSocat | ||
[WebSocat](https://github.com/vi/websocat) is a versatile tool for working with websockets from the command line. Below are some examples of using WebSocat to test the websocket endpoint: | ||
|
||
```bash | ||
# Start server | ||
make run | ||
``` | ||
|
||
```bash | ||
# Connect to the websocket endpoint | ||
$ websocat ws://localhost:PORT/websocket | ||
``` | ||
|
||
Replace `PORT` with the port number on which your server is running. | ||
|
||
## Sample Output | ||
Upon successful connection, the client should start receiving timestamp messages from the server every 2 seconds. | ||
|
||
```bash | ||
server timestamp: 1709046650354893857 | ||
server timestamp: 1709046652355956336 | ||
server timestamp: 1709046654357101642 | ||
server timestamp: 1709046656357202535 | ||
server timestamp: 1709046658358258120 | ||
server timestamp: 1709046660359338389 | ||
server timestamp: 1709046662360422533 | ||
server timestamp: 1709046664361194735 | ||
server timestamp: 1709046666362308678 | ||
server timestamp: 1709046668363390475 | ||
server timestamp: 1709046670364477838 | ||
server timestamp: 1709046672365193667 | ||
server timestamp: 1709046674366265199 | ||
server timestamp: 1709046676366564490 | ||
server timestamp: 1709046678367646090 | ||
server timestamp: 1709046680367851980 | ||
server timestamp: 1709046682368920527 | ||
``` |