You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/en/server-hosting/setting-up-high-bandwidth-transfer.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,13 @@
1
1
# Setting up High Bandwidth Transfer
2
2
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.
4
4
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.
10
6
11
7
### Game server config
12
8
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).
13
9
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`).
15
11
16
12
```admonish info "Straight to prod!!!"
17
13
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
21
17
Obviously for the changes to persist, you will need to also set it in your config.
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!
39
37
40
-
If you are, keep reading.
38
+
### Reverse proxy configuration
41
39
42
40
```admonish warning "Be sure to reload and not restart!"
43
41
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
48
46
If you are using something non standard look up how to reload its config in place.
49
47
```
50
48
51
-
### Nginx example
49
+
####Nginx example
52
50
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).
53
51
54
52
```
@@ -73,7 +71,7 @@ server {
73
71
```
74
72
75
73
76
-
### Caddy example
74
+
####Caddy example
77
75
Caddy should just automatically forward the right headers by just using the usual [`reverse_proxy` directive](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy).
78
76
79
77
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