https://github.com/wlun001/scaling-ws
Example of scaling real-time servers, such as Websocket
https://github.com/wlun001/scaling-ws
golang horizontal-scaling nats real-time vue websocket
Last synced: 4 days ago
JSON representation
Example of scaling real-time servers, such as Websocket
- Host: GitHub
- URL: https://github.com/wlun001/scaling-ws
- Owner: WLun001
- License: mit
- Created: 2020-09-15T13:07:37.000Z (about 5 years ago)
- Default Branch: solution-nats-ws-part2
- Last Pushed: 2021-06-20T06:53:20.000Z (over 4 years ago)
- Last Synced: 2025-04-04T02:14:12.864Z (6 months ago)
- Topics: golang, horizontal-scaling, nats, real-time, vue, websocket
- Language: Vue
- Homepage: https://blog.yongweilun.me/scaling-real-time-servers-with-nats-part-1-ckf5559jt021qors14c2zan0u
- Size: 673 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Get started
- For initial problem, checkout `problem` branch
- For nats solution, checkout `solution-nats-ws` branch
- For final solution, checkout `solution-nats-ws-part2` branch## How to run
### `solution-nats-ws-part2` branch
```bash
# on terminal
# start web ui
cd web
npm i && npm run serve# open another terminal
# start nats-server
# make sure it is installed
nats-server -c nats.conf# open another terminal
# start api server
make start-api
```
Open two tabs on `http://localhost:8080`### `problem` branch
```bash
# on terminal
# start web ui
cd web
npm i && npm run serve# open another terminal
# start ws server
go run main.go --addr :4000 --skipWs# open another terminal
# start api server
go run main.go
```
Open two tabs on `http://localhost:8080`### `solution-nats-ws` branch
```bash
# on terminal
# start web ui
cd web
npm i && npm run serve# open another terminal
# start nats-server
# make sure it is installed
nats-server# open another terminal
# start api server
make start-api# open another terminal
# start ws server
make start-ws
```
Open two tabs on `http://localhost:8080`