-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
portaldf.Config is passed directly to New, Enable, or EnableWithLogger — see Installation. There is no config file; set these fields in your own main.go (read them from your own TOML/JSON/env config if you want them adjustable without a rebuild).
| Field | Description | Default (DefaultConfig()) |
|---|---|---|
ProxyAddress |
IP address of the Portal proxy | 127.0.0.1 |
SocketPort |
Communication socket port — matches Portal's network.communication.address port |
19131 |
Secret |
Authentication secret — must match Portal's network.communication.secret exactly |
"" |
ServerName |
Server identifier on the proxy (e.g. "Hub1", "SkyWars1") |
Server1 |
ServerAddress |
Address for the proxy to connect players to. Format depends on Transport — see Transport Setup
|
127.0.0.1:19132 |
Transport |
Network transport the proxy dials this server with: portaldf.TransportRakNet or portaldf.TransportNetherNet
|
TransportRakNet |
Group |
Load-balancer group this server belongs to. Empty = no group | "" |
Weight |
Share of new players relative to others in the group. 0 is treated as 1
|
0 |
portaldf.DefaultConfig() // == Config{
// ProxyAddress: "127.0.0.1",
// SocketPort: 19131,
// ServerName: "Server1",
// ServerAddress: "127.0.0.1:19132",
// Transport: TransportRakNet,
// }Useful as a base to override a couple of fields from, rather than writing out every field yourself.
Must match Portal's network.communication.secret exactly — see the proxy's own Configuration page. A mismatch fails authentication (AuthResponseIncorrectSecret); Portal's own log will show a failed authentication attempt.
Only one connection may be authenticated under a given ServerName at a time — a second one is rejected (AuthResponseAlreadyConnected). If you're restarting this server, make sure the old connection has actually dropped (Portal logs socket connection "<name>" closed) before the new one tries to register with the same name, or give it a moment and let the built-in reconnect loop retry.
These back Portal's group-aware load balancing — see Portal's Socket Protocol page for exactly how they're used. Leave Group empty and every server (regardless of platform or library) is balanced together as one pool; set the same Group string on several servers to pool them separately, and use Weight to skew how large a share of new players each gets within that pool.