laravel-websockets
laravel-websockets copied to clipboard
Docker no connection
Hello,
I have Laravel running in a Docker environment with the packages mysql,nginx and php-fpm. I use this as an API. I now want to add the websocket server, this also works, I can start the server via php artisan websocket:serve. Via the statistic laravel-websockets I can connect to the websocket server, I can also see that in the console.
However, I can't connect from my VUE app or from a web socket test client, I can't get a connection.
What do I have to do? How do I get the connection from Docker to my client?
Thank you very much.
Does anyone have an idea for my problem?
Again as supplemental info, I have a Laravel backend and a separate Vue project. This Vue project is not in the Laravel directories!
This highly depends on how your Docker is setup. You'll want to set the PUSHER_ENDPOINT_HOST
to the IP of the correct container, not just 127.0.0.1
.
Hi thanks for your replay. Where does this variable belong?
By the way is it possible to have the server in project A and the FrontEnd in another project, so a pure vue.js project? I still find examples where Laravel and Vue are in one project.
This is actually my not working config:
subscribe() { const pusher = new Pusher( 'Tx1f8zribV', { cluster: 'mt1', enabledTransports: ['ws'], PUSHER_ENDPOINT_HOST: 'workspace', host: 'workspace', }, ); Pusher.log = (msg) => { console.log(msg); }; pusher.subscribe('GAUpdate'); pusher.bind('GAUpdate', (data) => { console.log(data); }); }, },
Hello,
I have Laravel running in a Docker environment with the packages mysql,nginx and php-fpm. I use this as an API. I now want to add the websocket server, this also works, I can start the server via php artisan websocket:serve. Via the statistic laravel-websockets I can connect to the websocket server, I can also see that in the console.
However, I can't connect from my VUE app or from a web socket test client, I can't get a connection.
What do I have to do? How do I get the connection from Docker to my client?
Thank you very much.
you can specify a port to execute the supervisor that runs the websocket in docker image it works like this for me
Hello,
I have Laravel running in a Docker environment with the packages mysql,nginx and php-fpm. I use this as an API. I now want to add the websocket server, this also works, I can start the server via php artisan websocket:serve. Via the statistic laravel-websockets I can connect to the websocket server, I can also see that in the console.
However, I can't connect from my VUE app or from a web socket test client, I can't get a connection.
What do I have to do? How do I get the connection from Docker to my client?
Thank you very much.
I also have Laravel running in a Docker environment with the packages mysql,nginx and php-fpm , but i am struggling in the config of ws in ngnix , can you help me ? websocket is served and everything is running okay , but i can't connect via the statistic laravel-websockets