Listen on udp workaround?
I understand that railway doesn't support it out of the box, but what could be the workaround? I have tinkered with this repo quite a bit : https://github.com/mmmaxwwwell/space-engineers-dedicated-docker-linux
The only thing stopping it from actually working on railway rn (aside from 5 gb limit on volume, which would need to be 10 gb for it to run on my personal hobby plan and not as one of team projects, lol) is well, the fact, that server needs to support udp 😦
I think someone mentioned using proxy for that?
GitHub
GitHub - mmmaxwwwell/space-engineers-dedicated-docker-linux: Space ...
Space Engineers Dedicated Server running in Docker for Linux - GitHub - mmmaxwwwell/space-engineers-dedicated-docker-linux: Space Engineers Dedicated Server running in Docker for Linux
22 Replies
Project ID:
N/A
N/A
@emma you said in the other branch "eh, i guess you could if you ran your own service outside of railway to convert back to udp", I would really appreciate if you could give me a few pointers 👀
LOL i said possible, not advisable. this is not a smart idea
How awful would that be in terms of
not…. good
any ideas for workaround that would work better? ;_;
don’t use railway?
(except "nag on railway team untill they implement it")
you also probably want persistent storage for a game server, no?
well, attached volume works, so that can be done on railway
it is like 7.5 Gb
not much in terms of costs, I think?
but out of hobby plan, which is eugh
For now, I just want to essentially do this as POC. I mean, railway end goal, as I understand it, is to support this kind of thing too
And I do like the platform
So I'd like to be able to host whatever comes to my mind (and not against ToS) here
i mean it’s definitely feasible, but it’s not what railway seems to be designed with in mind
GitHub
GitHub - mullvad/udp-over-tcp: Proxy UDP traffic over a TCP stream
Proxy UDP traffic over a TCP stream. Contribute to mullvad/udp-over-tcp development by creating an account on GitHub.
Looking at this
I could potentially just plug it as daemon run service into my container, I think
No need for external services.
So one [Udp2Tcp] instance can handle traffic from a single peer only.
this is not pretty though 🤔
If railway allowed multiple listen ports, the easiest (although super clunky) solution would be just to attach a separate instance to each of them, which is good enough for like server for 4 friends. With the way it is now, hmmm. I think still doable, but too much work I guess. I'll still test if it works for single connection some time later.if you wanted to bypass railway’s http forwarding you could run a vpn on an external device that forwards to the server running on railway
you’d have to do some fun network finagling to get the server to see the correct remote ips
or you could just run tailscale (or something similar) on each client and have a separate vpn connection per client
I am working on a template that creates a VPC with tailscale (a "subnet router"), resolves Railway IP Addresses from any device running tailscale, and routes traffic through each subnet router.
This does not allow Railway services without tailscale to connect to other Railway private environments/services, but that could be done easily by adding tailscale to the service (or adding routes). The intent is to allow remote administration of all Railway services, and provide a VPC to serve truly private services (that will never be public).
Each environment runs a single service/node with tailscale, and the same service runs dnsmasq. A background script calls the Railway Api to get the IPv6 addresses and create an alternate
hosts
file that dnsmasq reads (with custom domain like *.prod.alt
). The tailscale DNS servers are added to tailscale so any device running tailscale can connect to the Railway environment (that the subnet router is in).
I intend to publish it as some point, but the code is not clean at the moment.
Tailscale runs in userspace networking, so UDP doesn't work as expected. I tried to mesh together DNS servers (in each environment) that would query each other (and obtain the correct DNS records from the Railway DNS) but I did get stuck on UDP traffic. I tried a custom build of socat
(with socks5), tcp2udp
, and udp2tcp
, and a variety of each. I had varying levels of success, but ultimately felt I ran into issues related to conversion of UDP/TCP traffic and forking; that is, I could send and receive, but the packets were malformed and terminated prematurely.
Are you trying to route UDP over TCP or TCP over UDP?This is a good question, because I'm not quite sure about the internals of space engineers, but I assume I need both. I need first to listen to incoming udp traffic and then send udp traffic from my server
Here's what I mean. The WP test instance is not running tailscale.
Listening over UDP via public network a problem. You'll need to listen over TCP and covert to UDP, or use tailscale (and still need to convert).
If you're using tailscale, you may need a custom build of
socat
(with socks5
support) and udp2tcp
/tcp2udp
. Due to userspace networking, you have to route UDP traffic over SOCKS5
(socat
) and you may need to use tcp2udp
/udp2tcp
to convert between TCP and UDP (on both ends). It's complicated and not really an area I want to become an expert in, which is why I gave up; for my use cases, there are workarounds.
From my dockerfile
:
And start.sh
:
Yikes 😅 Thank you for sharing, I think i'll try this thing first and if it doesn't work, I'll probably drop the idea too
This is from my desktop which is connected to Tailscale. Two tailscale devices (self + subnet router) that can resolve IPv6 and connect to other services within the railway private network (WP does not have tailscale installed).
Ping is from East coast to West coast (USA) using Tailscale DERP servers. Ping is typically around ~80-85ms, which about double the ping to the production URL (because that's on an edge network and located on the East coast); the ping is roughly the same as a speed test. All that to say, the ping is exactly that it should be using tailscale and I have not found issues with throughput.
Can you guys share how one would run a tailscale node as a subnet router since private networking is done via domains and not ip?