mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-12-11 00:11:14 -05:00
50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
# 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]
|
|
|
|
Add a WebSocket listener to soju, e.g. `listen wss://127.0.0.1:8080`. Then
|
|
configure your reverse proxy to serve gamja files and proxy `/socket` to soju.
|
|
|
|
## [webircgateway]
|
|
|
|
Setup webircgateway to serve gamja files:
|
|
|
|
```ini
|
|
[fileserving]
|
|
enabled = true
|
|
webroot = /path/to/gamja
|
|
```
|
|
|
|
Then connect to webircgateway and append `?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 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).
|
|
|
|
[soju]: https://soju.im
|
|
[webircgateway]: https://github.com/kiwiirc/webircgateway
|