1. The problem I’m having:
I’m trying out soju IRC bouncer with gamja web UI. I’m running soju with
soju -listen ws+insecure://127.0.0.1:3001
which succeeds, but navigating to the subdomain I get
WebSocket protocol violation: Connection header "" does not contain Upgrade
I thought I don’t need to add any headers.
soju uses the websocket library for Go.
3. Caddy version:
2.6.4
4. How I installed and ran Caddy:
a. System environment:
Arch Linux
c. Service/unit/compose file:
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
irc.blabla.com {
encode gzip
tls my@email.com
root * /var/www/irc
file_server
reverse_proxy http://127.0.0.1:3001
}
gamja docs propose an nginx config:
location / {
root /path/to/gamja;
}
location /socket {
proxy_pass http://127.0.0.1:8080;
proxy_read_timeout 600s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
5. Links to relevant resources:
https://git.sr.ht/~emersion/gamja
https://git.sr.ht/~emersion/soju/tree/master/doc/getting-started.md
https://soju.im/doc/soju.1.html