Update: it is that simple. Passing the --port={port} parameter when using php artisan websockets:serve allows a different port to be used.
Feb 20, 2019
1
Level 8
Websockets Server on Homestead using Laravel Websockets
I'm using the beyondcode/laravel-websockets package and I'm trying to start the websockets server on Homestead.
I've SSH'd into Homestead and ran php artisan websockets:serve command to start the server however it keeps throwing back an error saying the address is already in use.
$ php artisan websockets:serve
Starting the WebSocket server on port 6001...
RuntimeException : Failed to listen on "tcp://0.0.0.0:6001": Address already in use
at /home/vagrant/code/websockets/vendor/react/socket/src/TcpServer.php:164
160| \STREAM_SERVER_BIND | \STREAM_SERVER_LISTEN,
A quick check with sudo lsof -i -P -n | grep LISTEN shows the vagrant php service is using the port. How would I change the port for websockets, is it just as simple as changing the port in broadcasting.php and restarting the server?
Level 8
Please or to participate in this conversation.