diff options
author | Himbeer <himbeer@disroot.org> | 2024-11-17 17:37:57 +0100 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-11-17 17:43:45 +0100 |
commit | 3bff2563fae6af73013e964e7e08109cea6fef4f (patch) | |
tree | 0a7232d98862af1ad59f9abdc01c73ef4dc17c94 /doc | |
parent | 7b69e587118c299d1601680ef70241283f30a009 (diff) |
Allow plugins to override server selection when a client joins
Closes #129.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/config.md | 8 | ||||
-rw-r--r-- | doc/server_selectors.md | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/config.md b/doc/config.md index 687476e..36a16c9 100644 --- a/doc/config.md +++ b/doc/config.md @@ -103,6 +103,14 @@ Default: "" Description: The default server to connect new clients to. May be a group. ``` +> `SrvSelector` +``` +Type: string +Default: "" +Description: The server selection handler to use for new clients. +Only useful when combined with a plugin providing a handler with that name. +``` + > `Servers` ``` Type: map[string]Server diff --git a/doc/server_selectors.md b/doc/server_selectors.md new file mode 100644 index 0000000..ce4a4d5 --- /dev/null +++ b/doc/server_selectors.md @@ -0,0 +1,12 @@ +# Server selectors + +If needed, plugins can provide a custom function to choose the server to +connect a new client to. To do this, call the [RegisterSrvSelector](https://pkg.go.dev/github.com/HimbeerserverDE/mt-multiserver-proxy#RegisterSrvSelector) +function. + +Use the `SrvSelector` configuration option to choose one of the registered +server selectors. This option is reloadable. + +If the configured server selector doesn't exist or doesn't return a server, the +proxy uses the builtin server selection strategy. In the case where the +configured server selector doesn't exist, a log message is generated. |