2.3 KiB
2.3 KiB
Halext collaboration server hookup (yaze.halext.org)
Goal: keep the WASM bundle on GitHub Pages but let the page at https://yaze.halext.org talk to the collab server running on the box. The client now auto-points to wss://<host>/ws for any *.halext.org host when no server URL is configured.
What changed in code
src/web/core/config.jsnow falls back towss://<current-host>/wswhen the page is served from ahalext.orgdomain and no explicitwindow.YAZE_CONFIG.collaboration.serverUrlor meta tag is set. This keeps GH Pages (front-end) and the collab server (backend) on the same origin.
Nginx work (needs sudo)
Edit /etc/nginx/sites/yaze.halext.org.conf so GitHub Pages stays the default, but WebSocket/HTTP traffic under /ws proxies to the collab server on 127.0.0.1:8765.
Add inside the server { ... } block that listens on 443:
# Collab server (WS + HTTP)
location /ws/ {
proxy_pass http://127.0.0.1:8765/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 7d;
proxy_send_timeout 7d;
proxy_buffering off;
}
Keep the existing / proxy to GitHub Pages so the WASM UI still serves from GH.
Then reload nginx (as root):
sudo nginx -t && sudo systemctl reload nginx
Collab server config check (no sudo required)
- Service: user systemd unit
yaze-server.servicealready runs/home/halext/yaze-server/server.json port 8765. - Allowed origins in
/home/halext/.config/yaze-server.envincludehttps://yaze.halext.org; leave secrets untouched. - Health:
curl -H "Origin: https://yaze.halext.org" http://127.0.0.1:8765/health(from the server) should return status 200.
Usage once nginx is updated
- Load
https://yaze.halext.org(served from GH Pages). The collab client should auto-connect towss://yaze.halext.org/ws. - Hosting/joining creates distinct room codes; multiple rooms can coexist. Admin API remains on the same origin under
/ws/admin/...withx-admin-keyheader.
No secrets were changed; only client fallback logic was added locally.