项目作者: WLun001

项目描述 :
Example of scaling real-time servers, such as Websocket
高级语言: Go
项目地址: git://github.com/WLun001/scaling-ws.git
创建时间: 2020-09-15T13:07:37Z
项目社区:https://github.com/WLun001/scaling-ws

开源协议:

下载


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

  1. # on terminal
  2. # start web ui
  3. cd web
  4. npm i && npm run serve
  5. # open another terminal
  6. # start nats-server
  7. # make sure it is installed
  8. nats-server -c nats.conf
  9. # open another terminal
  10. # start api server
  11. make start-api

Open two tabs on http://localhost:8080

problem branch

  1. # on terminal
  2. # start web ui
  3. cd web
  4. npm i && npm run serve
  5. # open another terminal
  6. # start ws server
  7. go run main.go --addr :4000 --skipWs
  8. # open another terminal
  9. # start api server
  10. go run main.go

Open two tabs on http://localhost:8080

solution-nats-ws branch

  1. # on terminal
  2. # start web ui
  3. cd web
  4. npm i && npm run serve
  5. # open another terminal
  6. # start nats-server
  7. # make sure it is installed
  8. nats-server
  9. # open another terminal
  10. # start api server
  11. make start-api
  12. # open another terminal
  13. # start ws server
  14. make start-ws

Open two tabs on http://localhost:8080