Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse proxy to multiple minecraft servers based on domain #40

Open
timvisee opened this issue Jan 12, 2023 Discussed in #35 · 2 comments
Open

Reverse proxy to multiple minecraft servers based on domain #40

timvisee opened this issue Jan 12, 2023 Discussed in #35 · 2 comments
Labels
enhancement New feature or request

Comments

@timvisee
Copy link
Owner

Discussed in #35

Originally posted by tW4r December 21, 2022
This project already does proxying
internet:25565 -> lazymc:25565 -> minecraft server:25566

It is possible to determine the domain the user is connecting to from the login packet
Based on this fact it is possible to direct them to different minecraft servers as such

server-a.example.com:25565 \                  / minecraft server-a:25566
                           +-> lazymc:25565 ->+
server-b.example.com:25565 /                  \ minecraft server-b:25567

An example of this is infrared (https://github.com/haveachin/infrared)

I would imagine it could work by splitting lazymc.toml to multiple files in a config directory:

# file 1
[public]
address="server-a.example.com"
[server]
address="127.0.0.1:22566"
# file 2
[public]
address="server-b.example.com"
[server]
address="127.0.0.1:22567"
```</div>
@tW4r
Copy link
Contributor

tW4r commented Feb 9, 2023

I've added a draft PR #42 for this, if you have some time it'd be great if you could tell me if I'm going the right direction

@joesturge
Copy link

If you use docker, I have created a solution to this problem: https://github.com/joesturge/lazymc-docker-proxy?tab=readme-ov-file#multiple-server-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants