Struggling to connect unity to websockets that are hosted on railway
smoothcubegit
HOBBYOP

a year ago

Title explains it

Solved

37 Replies

smoothcubegit
HOBBYOP

a year ago

N/A


smoothcubegit
HOBBYOP

a year ago


smoothcubegit
HOBBYOP

a year ago

The python code works.


smoothcubegit
HOBBYOP

a year ago

Just not Unity C#


smoothcubegit
HOBBYOP

a year ago

Just need some way to tackle it


a year ago

more details are needed here.

What are the websockets for? Does it work locally?


a year ago

this seems like a programming problem rather than a Railway issue


smoothcubegit
HOBBYOP

a year ago

railway responds to Python, not c# (websockets) for some reason


a year ago

have you tried running your websocket program locally?


a year ago

I’m not clear on what your goal is here


smoothcubegit
HOBBYOP

a year ago

To get the python code to work on unity Connecting to my server hosted on railway
(using c# not python obviously)


a year ago

This doesn’t seem to be a Railway specific issue, so unfortunately I won’t be much help. My advice would be to get your server hosted locally and get that working before transitioning to a live railway deployment


a year ago

you’ll have more freedom of configuration locally


smoothcubegit
HOBBYOP

a year ago

As I said it works locally, for python and c#.
Maybe websockets handle differently for c# online (GO servers)?


a year ago

you never said it works locally. Can you please explain exactly what your issue is? you have not provided errors or a clear problem statement


smoothcubegit
HOBBYOP

a year ago

very sorry, i'm not helping here XD


a year ago

I’m assuming you are running Unity locally and attempting to connect to a websocket server running on Railway. What I don’t understand is where the different languages come into play.


smoothcubegit
HOBBYOP

a year ago

maybe its the different libraries?


smoothcubegit
HOBBYOP

a year ago

the server works locally for python and c# however when hosting online it struggles to send responses back to the unity client


a year ago

Struggles how? Are there logs?


smoothcubegit
HOBBYOP

a year ago

Missing EOF headers, searched it up and got nothing, went to ai and got nothing


a year ago

please send logs


smoothcubegit
HOBBYOP

a year ago

2025/04/20 18:54:59 🔗 New session connected: 0f4a33db5a32f882906e13995369dea1f7a54194c910001f416a6198be30cce0 (IP: ---.---.---.--)

2025/04/20 18:56:45 WebSocket read error: failed to get reader: failed to read frame header: EOF


a year ago

the entire log file, not just a snippet


a year ago

what language and framework is the server? I’ll need more details about it to help you further. Code would be helpful


smoothcubegit
HOBBYOP

a year ago

1363592216295116800


smoothcubegit
HOBBYOP

a year ago

The language is go, the framework is github.com/coder/websocket and github.com/go-chi/chi/v5

the python code was provided previously


smoothcubegit
HOBBYOP

a year ago

the c# code is just one from chatgpt so im not too sure. that might be the issue
(the code has been deleted)

(it just converted the python code to c#)


a year ago

If your python code works and not your c# code, this is a programming issue that very likely has nothing to do with Railway, so I won’t be able to help further


a year ago

Especially if the code you used is from ChatGPT. There’s a very high chance it was wrong somehow


smoothcubegit
HOBBYOP

a year ago

do you think i should talk to some code outside of the unity project instead of it being inside of the files?


smoothcubegit
HOBBYOP

a year ago

correct haha


a year ago

I don’t understand this question


smoothcubegit
HOBBYOP

a year ago

its okay, it's a unity question instead lol, sorry for the misinterpretation


smoothcubegit
HOBBYOP

a year ago

you can close this ticket


a year ago

great, sorry I couldn’t help further


a year ago

!s


Status changed to Solved adam 11 months ago


Loading...