R
Railway13mo 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
Percy13mo ago
Project ID: 9a5465ad-1619-425d-bdcd-bb8ad5b7b25a
Joel
Joel13mo ago
9a5465ad-1619-425d-bdcd-bb8ad5b7b25a
Joel
Joel13mo 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
Brody13mo ago
you also need to listen on $PORT
Joel
Joel13mo ago
Yeah the same one as set in the Soketi env variables, or the port it randomly choosees. Same error
Brody
Brody13mo ago
soketi is just websockets right?
Joel
Joel13mo ago
Yep
Brody
Brody13mo ago
then it's definitely supported are running the soketi and laravel apps on separate railway services?
Joel
Joel13mo ago
Yes
Brody
Brody13mo ago
how are you calling the soketi service from your laravel service? like what URL are you using?
Joel
Joel13mo ago
I've tried 0.0.0.0, localhost, soketi
No description
Brody
Brody13mo 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
Joel13mo 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
Brody13mo ago
does your soketi railway service have a domain?
Joel
Joel13mo ago
not a custom one
Brody
Brody13mo 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
Joel13mo 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
Brody13mo ago
okay what host and what port is socketi currently listening on?
Joel
Joel13mo ago
This is all I get regarding host, I'm still unclear on how to set the host or tell what it is
Joel
Joel13mo ago
No description
Brody
Brody13mo 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
Joel13mo 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
Brody13mo ago
do you have a PORT service variable
Joel
Joel13mo ago
yes, I set it to 6001 just to keep it static
Brody
Brody13mo ago
you probably should read the socketi server docs to find out how to get it to listen on 0.0.0.0
Joel
Joel13mo 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
Brody13mo 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