Host Redirect is a plugin for the Gate proxy that allows you to redirect users based on the host they connect to.
Add the hostredirect
package to your Gate project:
go get github.com/dilllxd/hostredirect
Include the plugin in your main()
function:
func main() {
proxy.Plugins = append(proxy.Plugins,
// your plugins
hostredirect.Plugin,
)
gate.Execute()
}
After starting your server, a new file named mapping.yml
will be created. Configure it with your host-to-server mappings:
servermappings:
examplehost1.com: server1
examplehost2.com: server2
In this example, connections to examplehost1.com
will be redirected to server1
, and connections to examplehost2.com
will be redirected to server2
.
Feel free to reach out if you have any questions or need further assistance with setting up the Host Redirect plugin for Gate.