Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otsmr/websocket
Learning different langs by implementing the WebSocket protocoll.
https://github.com/otsmr/websocket
cpp rust websocket zig
Last synced: about 1 month ago
JSON representation
Learning different langs by implementing the WebSocket protocoll.
- Host: GitHub
- URL: https://github.com/otsmr/websocket
- Owner: otsmr
- Created: 2022-01-25T19:15:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-18T12:07:54.000Z (8 months ago)
- Last Synced: 2024-09-30T15:07:02.569Z (about 2 months ago)
- Topics: cpp, rust, websocket, zig
- Language: Zig
- Homepage:
- Size: 607 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Implementing WebSocket to learn
Sometimes I just want to learn a new language, and no, that has nothing to do
with [ThePrimeagen](https://twitter.com/ThePrimeagen) ([2022](https://twitter.com/intent/post?text=I%20know,%20Cpp,%20but%20let%20him%20cook,%20he%20just%20did%20not%20know%20@ThePrimeagen%20back%20then,%20so%20do%20not%20blame%20him%20for%20choosing%20Cpp%20in%202022...&url=https://github.com/otsmr/websocket),
[2023](https://twitter.com/ThePrimeagen/status/1634328728137265155),
[2024](https://twitter.com/ThePrimeagen/status/1761068465253744641)).## Languages
### 2024 (current): Zig
```sh
cd zig/
zig build run
```Then open `chat.html` for a simple chat application.
### 2023 - Rust
```sh
cd rust/
cargo run
```
### 2022 - C++
```sh
cd cpp/
./build.sh run
```## Getting started
1. Select lang and start server (see above)
2. Create test connection:
```sh
cat ./corpus/handshake - | nc localhost 3000
```## tests
The server implementation can be tested with the
[Autobahn|Testsuite](https://github.com/crossbario/autobahn-testsuite) as
follows:```bash
(rust) $ RUST_LOG=debug cargo run --bin wsserver_autobahn$ docker run -it --rm --net=host \
-v "${PWD}/tests:/config" \
-v "${PWD}/tests/reports:/reports" \
--name fuzzingclient \
crossbario/autobahn-testsuite \
wstest -m fuzzingclient --spec /config/fuzzingclient.json
```