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

a year ago

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

Solved

100 Replies

smoothcubegit
HOBBYOP

a year ago

N/A


a year ago

Railway doesn't support UDP yet


smoothcubegit
HOBBYOP

a year ago

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


a year ago

I'm not sure, I only use Railway so


a year ago

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


smoothcubegit
HOBBYOP

a year 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.


a year ago

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


smoothcubegit
HOBBYOP

a year 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

a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

there have been recent threads about it


smoothcubegit
HOBBYOP

a year ago

must be a thing that is starting to arise


a year ago

right but there isnt spend to back up the asks


smoothcubegit
HOBBYOP

a year ago

alright, how much would you request?


smoothcubegit
HOBBYOP

a year ago

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


a year 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

a year ago

damn, nah XD lost me there


smoothcubegit
HOBBYOP

a year ago

cant donate 100k, can do like £50 lol


smoothcubegit
HOBBYOP

a year ago

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

thanks for the support overall! Means a lot :D


a year ago

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


smoothcubegit
HOBBYOP

a year ago

I have a compromise


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year 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

a year 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)


a year 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

a year 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)


a year ago

we dont have any plans to implement it to begin with


smoothcubegit
HOBBYOP

a year ago

welp.


smoothcubegit
HOBBYOP

a year ago

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


a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

incoming though?


a year ago

we need to build a router for that


smoothcubegit
HOBBYOP

a year ago

ah…


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year ago

google cloud services it is?


a year ago

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


smoothcubegit
HOBBYOP

a year 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!


a year ago

websockets 🙂


smoothcubegit
HOBBYOP

a year 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

a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year ago

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


a year ago

websockets and go work just fine on railway

1362505070289092600


smoothcubegit
HOBBYOP

a year ago

alright amazing! just wanted to make sure


smoothcubegit
HOBBYOP

a year 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

a year 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

a year ago

cc @Fragly


a year ago

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


smoothcubegit
HOBBYOP

a year ago

OH, great XD


smoothcubegit
HOBBYOP

a year 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

a year 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())

a year 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

a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year 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 :(


a year ago

is your target port set correctly?


smoothcubegit
HOBBYOP

a year ago

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


a year ago

you need to set the target port in Railway


smoothcubegit
HOBBYOP

a year ago

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


a year ago

never overlook the docs -


a year ago

there's a search bar for a reason 😉


smoothcubegit
HOBBYOP

a year ago

AAAAAAAAAH!


smoothcubegit
HOBBYOP

a year ago

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


smoothcubegit
HOBBYOP

a year ago

1362916781257392400


smoothcubegit
HOBBYOP

a year ago

1362916934492094700


a year ago

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


smoothcubegit
HOBBYOP

a year ago

okay.. I'll try one last time


smoothcubegit
HOBBYOP

a year ago

Lost all hope :(
and internal motivation


smoothcubegit
HOBBYOP

a year 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

a year 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!!!


a year ago

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


smoothcubegit
HOBBYOP

a year ago

ooh… correct


smoothcubegit
HOBBYOP

a year 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

a year ago

timeout after timeout


a year ago

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


smoothcubegit
HOBBYOP

a year ago

okay. so i just run the code on clientside?


a year ago

yeah


smoothcubegit
HOBBYOP

a year ago

dude…


smoothcubegit
HOBBYOP

a year ago

Server says: Hello client!


smoothcubegit
HOBBYOP

a year ago

YEAH!!!

another Brody W


smoothcubegit
HOBBYOP

a year ago

what was the issue?


smoothcubegit
HOBBYOP

a year ago

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


a year ago

your target port was wrong, for future ref -

there's a search bar for a reason 😉


smoothcubegit
HOBBYOP

a year ago

Thank you tons!


smoothcubegit
HOBBYOP

a year ago

really means a lot, knowing support is this active


a year ago

imagine me when I'm not on my day off


smoothcubegit
HOBBYOP

a year ago

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

smoothcubegit
HOBBYOP

a year ago

Well thanks a ton


smoothcubegit
HOBBYOP

a year ago

really means a lot haha


smoothcubegit
HOBBYOP

a year ago

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


a year ago

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


smoothcubegit
HOBBYOP

a year ago

crikey, buzzin life



a year ago

!s


Status changed to Solved brody 11 months ago


Loading...