> For the complete documentation index, see [llms.txt](https://axiomemu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axiomemu.gitbook.io/docs/connectserver/connectserver-ini.md).

# ConnectServer.ini

Primary configuration file for ConnectServer. All keys live under a single `[ConnectServerInfo]` section.

## File Location

```
ConnectServer/ConnectServer.ini
```

Loaded once at startup. Changes require a ConnectServer restart.

## Configuration

All keys belong to section `[ConnectServerInfo]`.

| Key                    | Type   | Default   | Effect                                                                                                                                                                                                                                                                                                           |
| ---------------------- | ------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ConnectServerPortTCP` | int    | `44405`   | TCP port clients connect to for the server list. Must match the port the launcher hands off to the client. Exposed to the internet.                                                                                                                                                                              |
| `ConnectServerPortUDP` | int    | `55557`   | UDP port that receives heartbeats from JoinServer and every GameServer. Must match the `ConnectServerPort` value in JoinServer's [JoinServer.ini](/docs/joinserver/joinserver-ini.md) and each GameServer's [GameServerInfo - Common.dat](/docs/gameserver/common-dat.md). Internal traffic only; do not expose. |
| `MaxIpConnection`      | int    | `0`       | Maximum simultaneous client connections allowed from a single source IP. See [MaxIpConnection](#maxipconnection) below.                                                                                                                                                                                          |
| `LicenseKey`           | string | *(empty)* | License token tied to this ConnectServer instance. Required; empty or invalid prevents startup.                                                                                                                                                                                                                  |

## MaxIpConnection

Limits how many TCP connections a single source IP can hold at once against ConnectServer.

| Value      | Behavior                                                                                                  |
| ---------- | --------------------------------------------------------------------------------------------------------- |
| `0`        | Blocks every connection. Never set to `0` in a live deployment.                                           |
| `1` to `N` | Allows up to N simultaneous connections from each IP. Additional connections are rejected at accept time. |

{% hint style="danger" %}
`MaxIpConnection = 0` rejects every client. The shipped template uses `10`; if this key is missing from the file, the parser defaults to `0` and no one can connect.
{% endhint %}

Tune based on expected NAT'd clients sharing a public IP:

* `10` is reasonable for residential connections
* Higher values (e.g. `50`) suit LAN cafes or networks where many players share one gateway
* Lower values tighten per-IP scraping/bot pressure at the cost of legitimate shared-IP users

## Port Exposure

| Port                   | Protocol | Who connects             | Expose to internet |
| ---------------------- | -------- | ------------------------ | ------------------ |
| `ConnectServerPortTCP` | TCP      | Game clients             | Yes                |
| `ConnectServerPortUDP` | UDP      | JoinServer + GameServers | No                 |

Block `ConnectServerPortUDP` at the edge; only JS and GS hosts should reach it.

## Important Behavior

* Missing or unreadable `ConnectServer.ini` leaves `LicenseKey` empty, which aborts startup before any socket opens
* If any port key is absent, the default value from the table above is used; the sockets still open on those defaults
* If `MaxIpConnection` is absent from the file, the default is `0` and all connections are blocked
* `LicenseKey` is validated online at startup; activation failure aborts startup with no offline grace at that point. Once activated, runtime heartbeats have a grace window
* File is read with the Windows INI parser - quotes, trailing spaces, and BOM can cause silent value truncation

## Examples

{% tabs %}
{% tab title="Local development" %}
{% code title="ConnectServer.ini" %}

```ini
[ConnectServerInfo]
ConnectServerPortTCP = 44405
ConnectServerPortUDP = 55557
MaxIpConnection = 10
LicenseKey = YOUR-KEY-HERE
```

{% endcode %}
{% endtab %}

{% tab title="Tight per-IP limit" %}
{% code title="ConnectServer.ini" %}

```ini
[ConnectServerInfo]
ConnectServerPortTCP = 44405
ConnectServerPortUDP = 55557
MaxIpConnection = 3
LicenseKey = YOUR-KEY-HERE
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Common Issues

* **Every client fails to connect** - `MaxIpConnection` is `0` or missing from the file
* **Legitimate players rejected at high traffic times** - NAT pool sharing a public IP exceeds `MaxIpConnection`; raise it
* **JoinServer shows offline despite running** - `ConnectServerPortUDP` on this server does not match the `ConnectServerPort` set in [JoinServer.ini](/docs/joinserver/joinserver-ini.md)
* **Port already in use at startup** - another process is bound to `ConnectServerPortTCP` or `ConnectServerPortUDP`
