websocket
ws - websocket over http wss - websocket over https
ssl - WSS works on http? - Stack Overflow
- http 可连接 https,所以 http 应该可连 wss
- localhost 不受限制
websocket 是浏览器标准 nodejs 常用这个 https://github.com/websockets/ws koa2 用这个 koa-websocket 或 koa-socket
测试连接
yarn global add wscat
wscat -c ws://localhost:8083
fireship-io/socketio-minimal-demo: Minimal socket.io group chat demo
socket.io
库,支持自动降级(HTTP轮询)和重连