Skip to content

Commit 2c4b2e0

Browse files
committed
Improve docs about high bandwidth transfer
1 parent d9124b0 commit 2c4b2e0

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/en/server-hosting/setting-up-high-bandwidth-transfer.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# Setting up High Bandwidth Transfer
22

3-
As of [Robust Toolbox Version 271.1.0](https://github.com/space-wizards/RobustToolbox/blob/40b10f0dccfe568ccd7dc3c6f6ee87a63bad97ee/RELEASE-NOTES.md#27110) the engine supports a high bandwidth transfer mode using WebSockets.
3+
As of [Robust Toolbox Version 271.1.0](https://github.com/space-wizards/RobustToolbox/blob/40b10f0dccfe568ccd7dc3c6f6ee87a63bad97ee/RELEASE-NOTES.md#27110) the engine supports a "high bandwidth" transfer mode utilizing WebSockets. This enables features like admin resource upload/download to have higher bandwidth than supported by the game's normal networking layer, but requires some additional server setup. Content may implement additional features through the `ITransferManager` interface.
44

5-
This feature is used in resource upload/download allowing game admins to upload bigger prototypes quicker while allowing players to also download them as fast. But can also be implemented to do anything else you may want via `ITransferManager` that requires sending and receiving big traffic.
6-
7-
While Lidgren (The main networking net code) is the main fallback for the transfer system. To get the full speed benefits, some additional options need to be configured on the server.
8-
9-
A reverse proxy is highly recommended to be used here to allow you to encrypt the WebSocket traffic, but is not required. We will assume you know how to configure your web server with SSL/Know how to handle yourself if you do not wish to encrypt the data.
5+
Unlike regular game traffic, Robust does not implement an encryption layer for the WebSocket data. It is thus recommended that the game's HTTP status API is hosted behind a reverse proxy which is providing TLS, as otherwise the traffic will be unsecured. We will assume you know how to configure your web server with SSL, or at least know how to handle yourself if you do not wish to encrypt the data.
106

117
### Game server config
128
The main [CVars](https://github.com/space-wizards/RobustToolbox/blob/40b10f0dccfe568ccd7dc3c6f6ee87a63bad97ee/Robust.Shared/CVars.cs#L409-L448) are located here (Note this is a permalink, more CVars may exist by the time this page was written).
139

14-
The main one to worry about is `transfer.http_endpoint`, this needs to point to the servers HTTP API (The thing with the `/status` and `/info` if you ever queried that). In most cases this will be the same value as `hub.server_url` but instead replacing `ss14://` with `http://` and `ss14s://` with `https://`.
10+
The main one to worry about is `transfer.http_endpoint`, this needs to point to the servers HTTP API (The thing with the `/status` and `/info` if you ever queried that). In most cases this will be the same value as `hub.server_url` but instead replacing `ss14://` with `http://` and `ss14s://` with `https://`, and appending the port number (by default, `:1212`).
1511

1612
```admonish info "Straight to prod!!!"
1713
You can set these directly on a live server by editing the CVars via the `sudo cvar` command.
@@ -21,6 +17,8 @@ Note only players connecting after you enable the http transfer system will actu
2117
Obviously for the changes to persist, you will need to also set it in your config.
2218
```
2319

20+
An example from Wizard's Den Vulture:
21+
2422
```toml
2523
[transfer]
2624
http = true
@@ -37,7 +35,7 @@ http_endpoint = "http://203.0.113.125:1212"
3735

3836
If you are not using a reverse proxy... this should just work now! Try to (re)connect and see if you are successfully managing to connect!
3937

40-
If you are, keep reading.
38+
### Reverse proxy configuration
4139

4240
```admonish warning "Be sure to reload and not restart!"
4341
Most web servers support reloading the config instead of needing to fully restart. You should do this **especially** after you setup websockets, as the connection getting closed will disconnect all players.
@@ -48,7 +46,7 @@ So instead of `systemctl restart nginx` use `systemctl reload nginx` (Or whateve
4846
If you are using something non standard look up how to reload its config in place.
4947
```
5048

51-
### Nginx example
49+
#### Nginx example
5250
WebSockets in nginx require you to pass the `Upgrade` and `Connection` headers, we follow nginx's example config for WebSockets per their [documentation](https://nginx.org/en/docs/http/websocket.html).
5351

5452
```
@@ -73,7 +71,7 @@ server {
7371
```
7472

7573

76-
### Caddy example
74+
#### Caddy example
7775
Caddy should just automatically forward the right headers by just using the usual [`reverse_proxy` directive](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy).
7876

7977
Although be careful, as reloading the config will close active WebSockets connections by default [(I am not sure why this is the default)](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#streaming) which will cause your players to get disconnected from the server, so we recommend setting `stream_timeout` and `stream_close_delay`.

0 commit comments

Comments
 (0)