2023-11-12 04:03:05 -05:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
## [soju]
|
|
|
|
|
2024-03-19 09:27:44 -04:00
|
|
|
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.
|
2023-11-12 04:03:05 -05:00
|
|
|
|
|
|
|
## [webircgateway]
|
|
|
|
|
|
|
|
Setup webircgateway to serve gamja files:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[fileserving]
|
|
|
|
enabled = true
|
|
|
|
webroot = /path/to/gamja
|
|
|
|
```
|
|
|
|
|
2023-11-12 04:18:57 -05:00
|
|
|
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).
|
2023-11-12 04:03:05 -05:00
|
|
|
|
|
|
|
## 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";
|
2024-03-19 09:08:59 -04:00
|
|
|
proxy_set_header Host $host;
|
2023-11-12 04:03:05 -05:00
|
|
|
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).
|
|
|
|
|
2023-11-12 04:22:00 -05:00
|
|
|
## [kimchi]
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-11-12 04:03:05 -05:00
|
|
|
[soju]: https://soju.im
|
|
|
|
[webircgateway]: https://github.com/kiwiirc/webircgateway
|
2023-11-12 04:22:00 -05:00
|
|
|
[kimchi]: https://sr.ht/~emersion/kimchi/
|
2023-11-12 04:18:57 -05:00
|
|
|
[configuration file]: config-file.md
|