I am using Laravel 7.x and all the latest version of Laravel Websockets. I have installed it using Composer and I did everything as instructed in the documentation.
Once I SSH to the Devilbox using “./shell.sh” and CD into my project I use the command “php artisan websockets:serve” which gets stuck on “Starting the WebSocket server on port 6001…”.
I am assuming that this is related to 6001 port not being open. I have tried EXPOSE-ing it and many other things that I found while Google-ing it, but no luck.
Any tips or suggestions will be greatly appreciated!
devilbox@php-7.4.8 in /shared/httpd/websock/laravel-websockets-demo $ php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
at /shared/httpd/websock/laravel-websockets-demo/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")
/shared/httpd/websock/laravel-websockets-demo/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458
2 PDOStatement::execute()
/shared/httpd/websock/laravel-websockets-demo/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458
Please use the argument -v to see more details.
devilbox@php-7.4.8 in /shared/httpd/websock/laravel-websockets-demo $ php artisan websockets:serve
Starting the WebSocket server on port 6001...
And on another terminal I tried to get data from localhost, but this results in a 404
devilbox@php-7.4.8 in /shared/httpd $ curl -v localhost:6001
* Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 149999 ms for 3 (transfer 0x556532acef50)
* Expire in 200 ms for 4 (transfer 0x556532acef50)
* Connected to localhost (127.0.0.1) port 6001 (#0)
> GET / HTTP/1.1
> Host: localhost:6001
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< X-Powered-By: Ratchet/0.4.1
* no chunk, no close, no size. Assume close to signal end
<
* Closing connection 0
Doing the same with the reverse vhost:
devilbox@php-7.4.8 in /shared/httpd $ curl -v websock.loc
* Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55cc026eaf50)
* Connected to websock.loc (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: websock.loc
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: nginx/1.16.1
< Date: Tue, 14 Jul 2020 13:54:00 GMT
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: Ratchet/0.4.1
< Via: 1.1 httpd (nginx/1.16.1)
<
* Connection #0 to host websock.loc left intact
So exact same result. This means the reverse vhost works, but artisan is somewhat not correctly setup.