Skip to content

Commit

Permalink
tweak: proxy setup guide URL resolution clarification (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
blattersturm committed Nov 17, 2023
1 parent 007a356 commit 2a485e4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions content/docs/server-manual/proxy-setup.md
Expand Up @@ -11,9 +11,12 @@ At times, it may be desirable to have a reverse proxy in front of your Cfx.re se
The client->server connection process is as follows:

1. Client resolves the _connect endpoint_ from the join interaction. This can be any of the following:
* The `connectEndPoints` field in the server listing output.
* The server address cached by the join URL subsystem.
* The raw IP, host or URL entered in a `connect` command.
* The `connectEndPoints` field in the server listing output, which can be configured using `sv_listingHostOverride`.
* The server address cached by the join URL subsystem, such as from history.
* An IP, host or URL entered in a `connect` command. These get processed as follows:
* Bare hosts/IPs: `host.example` will resolve to `http://host.example:30120/`.
* Hosts with port: `host.example:30121` resolve to `http://host.example:30121/`.
* URLs with scheme: `http://host.example/` and `https://host.example/` will be resolved as-is, using the default ports for HTTP and HTTPS (80/443).
2. Client retrieves general server metadata via a `GET /info.json` on the connect endpoint.
3. Client attempts an `initConnect` request to the connect endpoint's `POST /client`.
4. If server accepts client, it'll send a connection token to client.
Expand Down Expand Up @@ -144,4 +147,4 @@ This setup can have a few variations as well:

* One could add the load balancer to a Kubernetes cluster as a proper ingress.
* If specifying a proper `location` block (e.g. a regular expression), the domain could be shared with, say, a web site.
* Implementing a custom handler for `/client` initConnect requests and delegating a successful connection to the actual backend server's `initConnect` sequence. This could be used for a server picker or some other creative things.
* Implementing a custom handler for `/client` initConnect requests and delegating a successful connection to the actual backend server's `initConnect` sequence. This could be used for a server picker or some other creative things.

0 comments on commit 2a485e4

Please sign in to comment.