Swapping services if I cant find a way to get UDP to work
smoothcubegit
HOBBYOP

10 months ago

Does railway even support UDP? Need it for my game server

Solved

100 Replies

smoothcubegit
HOBBYOP

10 months ago

N/A


dev
MODERATOR

10 months ago

Railway doesn't support UDP yet


smoothcubegit
HOBBYOP

10 months ago

what can I use instead of railway for UDP?
by Yet, should I wait? Or do it?


dev
MODERATOR

10 months ago

I'm not sure, I only use Railway so


dev
MODERATOR

10 months ago

I'd say it's worth waiting, unless you're in a hurry


smoothcubegit
HOBBYOP

10 months ago

well depends how long they take to do it, i wouldnt mind funding their research into implementing it.
I love railway, would be sad to not use it, for one reason.


brody
EMPLOYEE

10 months ago

it cant hurt for me to ask, how much would you pledge


smoothcubegit
HOBBYOP

10 months ago

I would put the money in depending in how long it takes to do it. I would need a time scale before I can estimate the pledge


smoothcubegit
HOBBYOP

10 months ago

As I said, I would do it for the cause. Just need to know for my sake, as a game developer as well


brody
EMPLOYEE

10 months ago

considering its not currently on the roadmap, it would have to be quite the sum of money


smoothcubegit
HOBBYOP

10 months ago

there have been recent threads about it


smoothcubegit
HOBBYOP

10 months ago

must be a thing that is starting to arise


brody
EMPLOYEE

10 months ago

right but there isnt spend to back up the asks


smoothcubegit
HOBBYOP

10 months ago

alright, how much would you request?


smoothcubegit
HOBBYOP

10 months ago

I dont want to set it too low, or too high. (Business 101)


brody
EMPLOYEE

10 months ago

we may be able to do it in the next quarter for a committed 100k spend, but im not the person who decided that stuff


smoothcubegit
HOBBYOP

10 months ago

damn, nah XD lost me there


smoothcubegit
HOBBYOP

10 months ago

cant donate 100k, can do like £50 lol


smoothcubegit
HOBBYOP

10 months ago

great, time to find a new service and migrate everything!

thanks for the support overall! Means a lot :D


brody
EMPLOYEE

10 months ago

unfortunately that wouldn't even get us talking about it, but i appreciate the sentiment


smoothcubegit
HOBBYOP

10 months ago

I have a compromise


smoothcubegit
HOBBYOP

10 months ago

I can use railway for my services and use something else for UDP


smoothcubegit
HOBBYOP

10 months ago

what other VPS could I use? (too lazy to migrate it all + already spent enough money on railway, i dont want to waste it)


smoothcubegit
HOBBYOP

10 months ago

what other VPS could I use? (too lazy to migrate it all + already spent enough money on railway, i dont want to waste it)

(still going to use railway as it does all the other stuff)
(UDP is seperate + the game servers)


brody
EMPLOYEE

10 months ago

i dont have any preferences, personally, if something doesnt run on railway I'd just build it differently until it can run on railway


smoothcubegit
HOBBYOP

10 months ago

can you give like a estimate of how long the team thinks it would take to implement, so i can have some faith

(and do what you suggest)


brody
EMPLOYEE

10 months ago

we dont have any plans to implement it to begin with


smoothcubegit
HOBBYOP

10 months ago

welp.


smoothcubegit
HOBBYOP

10 months ago

what are the reasons why outgoing is allowed but not incoming publicly?
(private incoming and outgoing is allowed, i know that)


brody
EMPLOYEE

10 months ago

we can't implement features without clear spend to back up the asks


brody
EMPLOYEE

10 months ago

outgoing udp traffic just works, we didnt need to do anything there, thats just how the internet works


smoothcubegit
HOBBYOP

10 months ago

incoming though?


brody
EMPLOYEE

10 months ago

we need to build a router for that


smoothcubegit
HOBBYOP

10 months ago

ah…


smoothcubegit
HOBBYOP

10 months ago

what if i build a virtual router? (im just yapping at this point)


smoothcubegit
HOBBYOP

10 months ago

google cloud services it is?


brody
EMPLOYEE

10 months ago

what if you build the server in a way that doesnt need udp


smoothcubegit
HOBBYOP

10 months ago

I'm making a realtime VR game so it requires low latency, if you can think of a way I can deliver data with low latency then please suggest!


brody
EMPLOYEE

10 months ago

websockets 🙂


smoothcubegit
HOBBYOP

10 months ago

I Can't for the life of me get my go socket to connect however… Which is strange as it all works and was double checked by several coders…


smoothcubegit
HOBBYOP

10 months ago

also isn't that http/https? (higher CPU bills)


brody
EMPLOYEE

10 months ago

yeah but once the connection is established and the upgrade made, then its just a data stream


smoothcubegit
HOBBYOP

10 months ago

I got python to work, but go doesnt for some reason work


smoothcubegit
HOBBYOP

10 months ago

which go is the language that is speedy and lightweight from what i know…


smoothcubegit
HOBBYOP

10 months ago

If I can get a low latency solution then there's no worry!


brody
EMPLOYEE

10 months ago

websockets and go work just fine on railway

1362505070289092600


smoothcubegit
HOBBYOP

10 months ago

alright amazing! just wanted to make sure


smoothcubegit
HOBBYOP

10 months ago

heyo! for the life of me, I cannot get websockets to work. There are no templates online, tried AI and it doesnt work, python overall is struggling, do you mind sharing some resources or code I could use for the server and client, secondly…

with this url what parts of it do we need?

wss://port-production-6c5f.up.railway.app:3004


smoothcubegit
HOBBYOP

10 months ago

As soon as websockets work even for a simple code we're good overall lol, just need something simple to go off as nothing is working


smoothcubegit
HOBBYOP

10 months ago

cc @Fragly


brody
EMPLOYEE

10 months ago

you cannot try to access your service on anything other than port 443


smoothcubegit
HOBBYOP

10 months ago

OH, great XD


smoothcubegit
HOBBYOP

10 months ago

alright let me try this again, if all else fails and i resort to throwing my computer out of a window, i'll come here!


smoothcubegit
HOBBYOP

10 months ago

damn, where have I gone wrong.

import asyncio
import websockets

async def connect():
    uri = "wss://port-production-6c5f.up.railway.app/ws"
    async with websockets.connect(uri) as websocket:
        msg = await websocket.recv()
        print("Server says:", msg)

asyncio.run(connect())
import asyncio
import websockets

async def handler(websocket):
    await websocket.send("Hello client!")

async def main():
    async with websockets.serve(handler, "0.0.0.0", 443, ssl=None):
        await asyncio.Future()

asyncio.run(main())

brody
EMPLOYEE

10 months ago

you shouldn't be listening on 443, listening on 3004 was fine, you just can't access the service publicly from 3004, you need to access the service publicly from 443


smoothcubegit
HOBBYOP

10 months ago

could you please share some code I could go from, I'm really lost
5 days of trying is finally hitting me


brody
EMPLOYEE

10 months ago

it's super simple, please just take the guidance I just gave


smoothcubegit
HOBBYOP

10 months ago

okay, I'll give it a shot! Else we'll see XD


brody
EMPLOYEE

10 months ago

if it still doesn't work, make sure your target port is set correctly


smoothcubegit
HOBBYOP

10 months ago

got it. (I hope, only deployment will tell)


smoothcubegit
HOBBYOP

10 months ago

Im really sorry if i'm just really bad at this and its super clear however I really dont know. Sorry :(

import asyncio
import websockets

async def connect():
    uri = "wss://port-production-6c5f.up.railway.app/ws"
    async with websockets.connect(uri) as websocket:
        msg = await websocket.recv()
        print("Server says:", msg)

asyncio.run(connect())
import asyncio
import websockets
import os

PORT = int(os.getenv("PORT", 3004))

async def handler(websocket):
    await websocket.send("Hello client!")

async def main():
    print(f"Listening on port {PORT}...")
    async with websockets.serve(handler, "0.0.0.0", PORT):
        await asyncio.Future()

asyncio.run(main())
Starting Container

Listening on port 8790...

again, to repeat, sorry :(


brody
EMPLOYEE

10 months ago

is your target port set correctly?


smoothcubegit
HOBBYOP

10 months ago

The port takes the OS port (server), unless I need to target a port in the client?


brody
EMPLOYEE

10 months ago

you need to set the target port in Railway


smoothcubegit
HOBBYOP

10 months ago

In the variables? Where sorry? The code?
Im somewhat blind at simple things


brody
EMPLOYEE

10 months ago

never overlook the docs -


brody
EMPLOYEE

10 months ago

there's a search bar for a reason 😉


smoothcubegit
HOBBYOP

10 months ago

AAAAAAAAAH!


smoothcubegit
HOBBYOP

10 months ago

oh, but i'm using the defualt generated domain?


smoothcubegit
HOBBYOP

10 months ago

1362916781257392400


smoothcubegit
HOBBYOP

10 months ago

1362916934492094700


brody
EMPLOYEE

10 months ago

you need to set it to the port your app is listening on


smoothcubegit
HOBBYOP

10 months ago

okay.. I'll try one last time


smoothcubegit
HOBBYOP

10 months ago

Lost all hope :(
and internal motivation


smoothcubegit
HOBBYOP

10 months ago

curl -i https://port-production-6c5f.up.railway.app
HTTP/1.1 404 Not Found
Content-Length: 112
Content-Type: application/json
Server: railway-edge
X-Railway-Edge: railway/europe-west4
X-Railway-Fallback: true
X-Railway-Request-Id: SsibjGmwTieYdhnlFWm6wQ_3243920489
Date: Fri, 18 Apr 2025 22:30:39 GMT

{"status":"error","code":404,"message":"Application not found","request_id":"SsibjGmwTieYdhnlFWm6wQ_3243920489"}

smoothcubegit
HOBBYOP

10 months ago

I know its simple and all, however i do request some sort of setup guide, or at least the code.
Im not letting the 5 days of struggle go to waste!!!


brody
EMPLOYEE

10 months ago

that's not the same domain that you just showed in your screenshot?


smoothcubegit
HOBBYOP

10 months ago

ooh… correct


smoothcubegit
HOBBYOP

10 months ago

curl -i https://port-production-751c.up.railway.app
HTTP/1.1 502 Bad Gateway
Content-Length: 120
Content-Type: application/json
Server: railway-edge
X-Railway-Edge: railway/europe-west4-drams3a
X-Railway-Fallback: true
X-Railway-Request-Id: NfayxZWvQp-S_HFEarGpug_3554946428
Date: Fri, 18 Apr 2025 22:35:55 GMT

{"status":"error","code":502,"message":"Application failed to respond","request_id":"NfayxZWvQp-S_HFEarGpug_3554946428"}

smoothcubegit
HOBBYOP

10 months ago

timeout after timeout


brody
EMPLOYEE

10 months ago

your target port was still wrong, i fixed that for you, please try again


smoothcubegit
HOBBYOP

10 months ago

okay. so i just run the code on clientside?


brody
EMPLOYEE

10 months ago

yeah


smoothcubegit
HOBBYOP

10 months ago

dude…


smoothcubegit
HOBBYOP

10 months ago

Server says: Hello client!


smoothcubegit
HOBBYOP

10 months ago

YEAH!!!

another Brody W


smoothcubegit
HOBBYOP

10 months ago

what was the issue?


smoothcubegit
HOBBYOP

10 months ago

like as in the port > it was 3004 when i set it


brody
EMPLOYEE

10 months ago

your target port was wrong, for future ref -

there's a search bar for a reason 😉


smoothcubegit
HOBBYOP

10 months ago

Thank you tons!


smoothcubegit
HOBBYOP

10 months ago

really means a lot, knowing support is this active


brody
EMPLOYEE

10 months ago

imagine me when I'm not on my day off


smoothcubegit
HOBBYOP

10 months ago

Brody turns on his phone
phone connects to internet provider
alerted of 100+ pings

smoothcubegit
HOBBYOP

10 months ago

Well thanks a ton


smoothcubegit
HOBBYOP

10 months ago

really means a lot haha


smoothcubegit
HOBBYOP

10 months ago

have a great one and dont forget to mark this as !s whenever you do it


brody
EMPLOYEE

10 months ago

slack and discord combined give me over 100 notifications a day according to android


smoothcubegit
HOBBYOP

10 months ago

crikey, buzzin life



brody
EMPLOYEE

10 months ago

!s


Status changed to Solved brody 10 months ago


Loading...