aboutsummaryrefslogtreecommitdiff
path: root/doc/server_selectors.md
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-11-17 17:37:57 +0100
committerHimbeer <himbeer@disroot.org>2024-11-17 17:43:45 +0100
commit3bff2563fae6af73013e964e7e08109cea6fef4f (patch)
tree0a7232d98862af1ad59f9abdc01c73ef4dc17c94 /doc/server_selectors.md
parent7b69e587118c299d1601680ef70241283f30a009 (diff)
Allow plugins to override server selection when a client joins
Closes #129.
Diffstat (limited to 'doc/server_selectors.md')
-rw-r--r--doc/server_selectors.md12
1 files changed, 12 insertions, 0 deletions
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.