R
Railway14mo ago
Joel

Soketi + Laravel

Hello, I'm struggling to connect Soketi and Laravel. I have it working in a Docker container locally, but porting everything to Railway gives me Pusher error: cURL error 7: Failed to connect when hitting an endpoint that attempts to connect. I've set Soketi to port 6001, but I don't know if I'm using the correct HOST in my env. I've tried combinations of localhost, 0.0.0.0, soketi with both http and https schemes but no luck.
28 Replies
Percy
Percy14mo ago
Project ID: 9a5465ad-1619-425d-bdcd-bb8ad5b7b25a
Joel
JoelOP14mo ago
9a5465ad-1619-425d-bdcd-bb8ad5b7b25a
Joel
JoelOP14mo ago
Yeah I've gone through that doc and the multiple similar questions where you've posted that answer and it works for people, but unfortunately listening on 0.0.0.0 gives me the same error
Brody
Brody14mo ago
you also need to listen on $PORT
Joel
JoelOP14mo ago
Yeah the same one as set in the Soketi env variables, or the port it randomly choosees. Same error
Brody
Brody14mo ago
soketi is just websockets right?
Joel
JoelOP14mo ago
Yep
Brody
Brody14mo ago
then it's definitely supported are running the soketi and laravel apps on separate railway services?
Joel
JoelOP14mo ago
Yes
Brody
Brody14mo ago
how are you calling the soketi service from your laravel service? like what URL are you using?
Joel
JoelOP14mo ago
I've tried 0.0.0.0, localhost, soketi
No description
Brody
Brody14mo ago
well you would need to use the url of the soketi service or since that doesn't look like it takes a url, use the services domain as the host, and 443 as the port
Joel
JoelOP14mo ago
After deploying the Soketi service it provides a public networking url that I tried using as the host, and also says using soketi should allow communication within railway
Brody
Brody14mo ago
does your soketi railway service have a domain?
Joel
JoelOP14mo ago
not a custom one
Brody
Brody14mo ago
doesn't need to have a custom one does it have a railway domain host: <railway domain> port: 443 scheme: https this is the connection object used to connect soketi from laravel right?
Joel
JoelOP14mo ago
Im not entirely sure tbh, it provides access to the Soketi server through something like soketi-8sc4.up.railway.app Yeah that's how laravel connects
Brody
Brody14mo ago
okay what host and what port is socketi currently listening on?
Joel
JoelOP14mo ago
This is all I get regarding host, I'm still unclear on how to set the host or tell what it is
Joel
JoelOP14mo ago
No description
Brody
Brody14mo ago
please read the doc page I linked again tl;dr socketi needs to listen on host 0.0.0.0 and the environment variable PORT and as mentioned previously a couple of times, the host you use to connect to socketi from your laravel app is the domain railway gives you let me know when you have done this please
Joel
JoelOP14mo ago
I have re-read it. Im probably missing something but based on that page, I've set HOST=0.0.0.0 on Soketi. It redeploys and still says server is available at 127.0.0.1:6001
Brody
Brody14mo ago
do you have a PORT service variable
Joel
JoelOP14mo ago
yes, I set it to 6001 just to keep it static
Brody
Brody14mo ago
you probably should read the socketi server docs to find out how to get it to listen on 0.0.0.0
Joel
JoelOP14mo ago
I'll try that again, thanks. Figured others would have had the same issue when using Soketi but maybe not Thanks for your time
Brody
Brody14mo ago
once that's done these would be the configs you need in laravel to connect
Want results from more Discord servers?
Add your server