You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Open up port 6001 for laravel-websockets (php via cli service) #12
@eminos the way the proxy works, it is proxying port 6001 inside the container to ports 80/443 (or whatever ports you have the proxy bound to) on the host, so what you really want to do is bind it to a DIFFERENT domain than the nginx appserver, like ws-lintext.local or ws.lintex.local etc.
This definitely isn't intuitive when the standard way to run stuff is localhost:newport but its how things work with our proxy.
You can find me in the Lando slack or the Laravel Discord if you have more questions!
Hey @eminos! I don't see the question, just made sure to login, my username over there is dustin#0971. I might have signed up with a couple of accounts over time as discord is weird with accounts/emails, but you can hit me there!
After a long chat with Dustin he helped me figure it all out! Thanks Dustin!
So for anyone wondering or having the same issue...
The key seems to be to proxy the websockets to a custom subdomain, and access websockets through that subdomain on port 80/443 instead. Also I'm running php artisan websockets:serve --port=80, which is the default proxy port, and makes so there is no need for ws.lintex.local:6001.
This is my .lando.yml. I hope it might help someone stumbling upon this issue.
@eminos Thanks for posting an update on this, it was super useful for me!
Some additional context I'll add from my own semi-related case, in case it's useful to others:
This line from the above landofile is very important, as it's what allows external access to the app's services: bindAddress: "0.0.0.0"
In my case, I only needed to expose a single process running within one of my services so it could be accessed from another service. Instead of globally setting bindAddress to 0.0.0.0, I was able to just bind that process to 0.0.0.0 instead of 127.0.0.1. That ended up looking like this in my case: beanstalkd -l 0.0.0.0 -p 11303
By binding the process to 0.0.0.0 on port 11303, I was then able to connect to the process from another service. For example, using telnet to connect from another service would look something like this: telnet {service-name}.{app-name}.internal 11303
@eminos I know this is an old issue, but do you remember if you started the server by setting a port flag? php artisan websockets:serve --port=443
to match the proxied domain? or the host flag? php artisan websocket:serve --host=<proxied lando host>
Activity
dustinleblanc commentedon Nov 18, 2020
@eminos the way the proxy works, it is proxying port 6001 inside the container to ports 80/443 (or whatever ports you have the proxy bound to) on the host, so what you really want to do is bind it to a DIFFERENT domain than the nginx appserver, like
ws-lintext.localorws.lintex.localetc.This definitely isn't intuitive when the standard way to run stuff is
localhost:newportbut its how things work with our proxy.You can find me in the Lando slack or the Laravel Discord if you have more questions!
eminos commentedon Nov 18, 2020
Thank you @dustinleblanc ! I do have some more questions. I wrote to you on the Laravel Discord. (Couldn't get access to Lando Slack.)
dustinleblanc commentedon Nov 18, 2020
Hey @eminos! I don't see the question, just made sure to login, my username over there is
dustin#0971. I might have signed up with a couple of accounts over time as discord is weird with accounts/emails, but you can hit me there!eminos commentedon Nov 18, 2020
After a long chat with Dustin he helped me figure it all out! Thanks Dustin!
So for anyone wondering or having the same issue...
The key seems to be to proxy the websockets to a custom subdomain, and access websockets through that subdomain on port 80/443 instead. Also I'm running
php artisan websockets:serve --port=80, which is the default proxy port, and makes so there is no need forws.lintex.local:6001.This is my
.lando.yml. I hope it might help someone stumbling upon this issue.sdunham commentedon Apr 6, 2021
@eminos Thanks for posting an update on this, it was super useful for me!
Some additional context I'll add from my own semi-related case, in case it's useful to others:
bindAddress: "0.0.0.0"bindAddressto0.0.0.0, I was able to just bind that process to0.0.0.0instead of127.0.0.1. That ended up looking like this in my case:beanstalkd -l 0.0.0.0 -p 113030.0.0.0on port11303, I was then able to connect to the process from another service. For example, using telnet to connect from another service would look something like this:telnet {service-name}.{app-name}.internal 11303aschkenasy commentedon Dec 21, 2022
@eminos I know this is an old issue, but do you remember if you started the server by setting a port flag?
php artisan websockets:serve --port=443to match the proxied domain? or the host flag?
php artisan websocket:serve --host=<proxied lando host>