R
Railway17mo ago
hyhy

Request to Soketi container hanging - not connecting properly?

Hey, pretty new to Railway containers - I'm trying to trigger a Pusher event, targeting a soketi container that I've got hosted. When I do this, the request is stuck in pending (network dev tools) until it eventually 500s. My application is a nextjs app using trpc hosted on vercel, but i'm currently testing it locally. I've attached: The trpc mutation including the code to trigger the event The pusher object, env file contains the secrets and host is my container address The container variables including a por variable someone suggested I try out The dockerfile for the container The network error When I remove the pusher.trigger call, the mutation works correctly. I assume the issue is that it's not able to communicate. If there's anything else I can show to help please let me know, I'm really stuck on this one.
25 Replies
Percy
Percy17mo ago
Project ID: 02a54cef-6536-4f93-8c8d-27320e2261e3
hyhy
hyhyOP17mo ago
02a54cef-6536-4f93-8c8d-27320e2261e3 Someone on another discord suggested trying to mess with the exposed ports but really not sure how best to approach this, not that experienced with docker
hyhy
hyhyOP17mo ago
this looks like it might be a culprit but i couldn't really follow the docs very easily
Brody
Brody17mo ago
does trpc use http as the transport?
hyhy
hyhyOP17mo ago
i think so yes
Brody
Brody17mo ago
please double check, because you can only run http services on railway at the moment
hyhy
hyhyOP17mo ago
then yes, i know other people have been able to get this working too
hyhy
hyhyOP17mo ago
GitHub
zapdos/src/utils/pusher.tsx at main · pingdotgg/zapdos
Contribute to pingdotgg/zapdos development by creating an account on GitHub.
Brody
Brody17mo ago
I don't know what that is, is it hosted on railway?
hyhy
hyhyOP17mo ago
it's an app that uses pusher functions for live comms on edge deployments - in theory you should be able to swap out the pusher environment variables for soketi ones (hosted on railway) and it should work the exact same way I've just tried connecting to pusher and triggering events on my app and it's working, so the problem is with connecting to the soketi instance and not anything else
Brody
Brody17mo ago
sounds good show me the code that connects to socketi please
hyhy
hyhyOP17mo ago
it should be this part here
hyhy
hyhyOP17mo ago
i've got app_id as default, app_domain as "socketi-productio-xxxxx.up.railway.app"
Brody
Brody17mo ago
you can only connect to your service externally from port 443
hyhy
hyhyOP17mo ago
ah i see i'll give that a try now it's not hanging anymore, just failing straight away, which I guess is an improvement
hyhy
hyhyOP17mo ago
will keep looking into it, i want to try and work out how to run on 0.0.0.0
Brody
Brody17mo ago
your app needs to listen on $PORT, not 443
hyhy
hyhyOP17mo ago
oh interesting
Brody
Brody17mo ago
and sometimes the logs will say 127.0.0.1 but still listen on 0.0.0.0 so that's not immediately a red flag
hyhy
hyhyOP17mo ago
as in, the Pusher object should have port: '$PORT', in it?
Brody
Brody17mo ago
is that an object for the client? or the server
hyhy
hyhyOP17mo ago
that's for the server
Brody
Brody17mo ago
then you want process.env.PORT
hyhy
hyhyOP17mo ago
ok thanks a bunch, i'll have a play with that and see if i can get anywhere
Brody
Brody17mo ago
if done correctly, this should show the port as some random 4 digit number
Want results from more Discord servers?
Add your server