The open source backend for Presencejs v2.0
- Websocket arraybuffer support
- Zero-copy upgrade to WebSocket
- SO_REUSEPORT on Darwin and Linux
- Implement WebSocket native Ping/Pong frame to keep alive
- reuse goroutine
- WebTransport Datagram support, unreliable but fast communication
- WebTransport Stream support, reliable
- pprof
- Prscd Clusters by YoMo
- Geo-distributed System / Distributed Cloud arch by YoMo
- Start prscd service in terminal-2:
make dev
- Open
webtransport.html
by Chrome with Dev Tools - Open
websocket.html
by Chrome with Dev Tools
Compile:
make dist
The docker way:
docker run --rm -it --network host --env-file prscd/env.example yomorun/prscd:latest
TODO: how to deploy prscd
on digitalocean
TODO: introducing geoping.gg, lighthouse for realtime applications.
DNS improvements explaination
Redirect end-user connect to node close to them.
Anycast IP
Geo-IP
about https://lo.yomo.dev
$ openssl x509 -enddate -noout -in prscd/lo.yomo.dev.cert
notAfter=May 22 07:40:45 2023 GMT
brew install certbot
sudo certbot certonly --manual --preferred-challenges dns -d prscd.example.com
- create a TXT record followed the instruction by certbot
nslookup -type=TXT _acme-challenge.prscd.example.com
to verify the processsudo chown -Rv "$(whoami)":staff /etc/letsencrypt/
set permission- cert and key:
/etc/letsencrypt/live/prscd.example.com/{fullchain, privkey}.pem
- verify the expiratioin time:
openssl x509 -enddate -noout -in prscd.example.com.cert.pem
Most of proxy applications drop WebTransport or HTTP/3, so if you are a macos user,
this bash script can helped bypass *.yomo.dev
domain to proxy.
networksetup -setproxybypassdomains "Wi-Fi" $(networksetup -getproxybypassdomains "Wi-Fi" | awk '{ printf "\"%s\" ", $0 }') "*.yomo.dev"
Currently, provide public_key
for authentication, the endpoint looks like: /v1?app_id=<USER_CLIENT_ID>&public_key=<PUBLIC_KEY>
Execute make dev
in terminal-1:
$ make dev
go run -race main.go
pid: 20079
Listening SIGUSR1, SIGUSR2, SIGTERM/SIGINT...
Open terminal-2, execute:
$ kill -SIGUSR1 20079
$ kill -SIGUSR2 20079
The output of terminal-1 will looks like:
$ make dev
go run -race main.go
pid: 20079
Listening SIGUSR1, SIGUSR2, SIGTERM/SIGINT...
Received signal: user defined signal 1
SIGUSR1
Dump start --------
Peers: 1
Channel:room-1
Peer:127.0.0.1:62577
Dump doen --------
Received signal: user defined signal 2
NumGC = 0
TCP and UDP on the PORT
shall has to be allowed in security rules.
-
DEBUG=true
: debug mode -
PORT=443
: indicate the PORT used to listen, both WebSocket and WebTransport -
MESH_ID=MID_EAST
: indicate nodes in distributed cloud archtecture -
YOMO_SNDR_NAME
: the name of YoMo Source -
YOMO_RCVR_NAME
: the name of YoMo Stream Function -
CERT_FILE
: The SSL cert file path of prscd -
YOMO_TRACE_JAEGER_ENDPOINT
: Jaeger collector endpoint, e.g., http://localhost:14268/api/traces -
KEY_FILE
: The SSL key file path of prscd