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
Project ID:
02a54cef-6536-4f93-8c8d-27320e2261e3
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
this looks like it might be a culprit but i couldn't really follow the docs very easily
does trpc use http as the transport?
i think so yes
please double check, because you can only run http services on railway at the moment
then yes, i know other people have been able to get this working too
https://github.com/pingdotgg/zapdos/blob/main/src/utils/pusher.tsx i know ping.gg's zapdos is set up this way
GitHub
zapdos/src/utils/pusher.tsx at main · pingdotgg/zapdos
Contribute to pingdotgg/zapdos development by creating an account on GitHub.
I don't know what that is, is it hosted on railway?
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
sounds good
show me the code that connects to socketi please
it should be this part here
i've got app_id as default, app_domain as "socketi-productio-xxxxx.up.railway.app"
you can only connect to your service externally from port 443
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
will keep looking into it, i want to try and work out how to run on 0.0.0.0
your app needs to listen on $PORT, not 443
oh interesting
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
as in, the Pusher object should have
port: '$PORT',
in it?
is that an object for the client?
or the server
that's for the server
then you want
process.env.PORT
ok thanks a bunch, i'll have a play with that and see if i can get anywhere
if done correctly, this should show the port as some random 4 digit number