mc-router icon indicating copy to clipboard operation
mc-router copied to clipboard

Forward UDP packet along same port?

Open Merith-TK opened this issue 2 years ago • 6 comments

Would it be possible to add an --enable-udp flag that allows proxying UDP traffic to the server?

probably listens on port for TCP and UDP then routes, and you could specify container port for udp traffic like so

{
	"mappings": {
		// base, proxies tcp/udp to port by default
		"example.com": "example:25565",
		// geyser example for use along side above
		"example.com" : "example:19132/tcp"	
	}
}

Merith-TK avatar May 15 '23 03:05 Merith-TK

It would need to interpret the RakNet protocol that bedrock uses on UDP to correctly route the datagrams to the associated backend. Worse still it would have to interpret and track every single datagram unlike the simplicity of Java edition's TCP stream based connections.

What's doable is if all you want is a "route all UDP traffic on the specified port to one backend".

itzg avatar May 15 '23 12:05 itzg

wait seriously? its that damn complicated?!

hmm... for bedrock a service like "geyserconnect" can be used for navigation, so an bedrock-container map would probably be the best bet to just forward bedrock traffic to a single container, and then let that handle the networking part, however things like Proximity Voice chat mods are probably easier?

so... proposed method of


{
	// this being anything but "" causes router to
	// listen on port 19132 and forward traffic on that
	// port to the bedrock container
	"bedrock" : "bedrock-container:19132"
	"mappings": {
		// base, proxies tcp by default, UDP if possible
		// (PlasmoVoice or SimpleVoice)
		"example.com": "example:25565"
	}
}

Merith-TK avatar May 15 '23 14:05 Merith-TK

Just noticed in the geyserconnect config there is this section at the bottom

# Enable virtual hosts to be specified to skip the server list
# Allows people to connect using addresses like
#   hypixel.net._p25565.example.com
#   hypixel.net.example.com
#   hypixel.net._o.example.com    - For offline mode
vhost:
  enabled: true
  base-domain: geyser.merith.xyz

Merith-TK avatar May 15 '23 15:05 Merith-TK

Popping in to say I have this same use-case and wondering what the current situation is. Seeing that UDP/Bedrock support might be out of scope for this project is there a better method/proxy for this? It would be helpful to add something like that to the docs/wiki even if it's not made by the same team behind your containers itzg. I can manage by opening 19132 on the container I use geyser in as at the moment i don't need it for more than one of my server, but that may change in the future. Hope to see some kind of easy solution for anyone else in the same position

Handrail9 avatar Aug 27 '23 08:08 Handrail9

I still haven't come across one, but would be very glad to add that as a pointer in the docs. I'm now thinking that searching for "raknet proxy" might be a good tactic since I believe that's the protocol/library on UDP that Bedrock is using.

BTW, team? 😀 It's just me...and a bunch of contributors. The sentiment makes me happy though.

itzg avatar Aug 27 '23 13:08 itzg

Well ykno, contributors, team, same thing right? I appreciate you a ton. Thanks for your work :)

Handrail9 avatar Aug 27 '23 15:08 Handrail9