Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 1.67 KB

setup.md

File metadata and controls

68 lines (52 loc) · 1.67 KB

Setting up gamja

An HTTP server must be configured to serve the gamja static files. Usually, the same HTTP server is used as a reverse proxy for the IRC WebSocket.

Add a WebSocket listener to soju, e.g. listen ws+insecure://127.0.0.1:8080. Then configure your reverse proxy to serve gamja files and proxy /socket to soju.

Setup webircgateway to serve gamja files:

[fileserving]
enabled = true
webroot = /path/to/gamja

Then configure gamja to connect to /webirc/websocket/ (either by setting server.url in the configuration file, or by appending ?server=/webirc/websocket/ to the URL).

nginx

If you use nginx as a reverse HTTP proxy, make sure to bump the default read timeout to a value higher than the IRC server PING interval. Example:

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 Host $host;
	proxy_set_header X-Forwarded-For $remote_addr;
	proxy_set_header X-Forwarded-Proto $scheme;
}

If you are unable to configure the proxy timeout accordingly, or if your IRC server doesn't send PINGs, you can set the server.ping option in config.json (see below).

Setup kimchi to serve gamja files and proxy the WebSocket connection:

site irc.example.org {
	file_server /path/to/gamja
}
site irc.example.org/socket {
	reverse_proxy http://127.0.0.1:8080
}