0
let socket = io.connect('http://127.0.0.1:1215/', {transports: ['websocket']});

i serve my laravel application with php swoole

php artisan swoole:http start 

i always get this error in console

WebSocket connection to 'ws://127.0.0.1:1215/socket.io/?EIO=3&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 404

Wahyu Kristianto
  • 8,719
  • 6
  • 43
  • 68

1 Answers1

0

Go to /config/swoole_http.php (dont forget to run vendor:publish)

'websocket' => [
    'enabled' => env('SWOOLE_HTTP_WEBSOCKET', true),
],
Klidi Spiro
  • 49
  • 1
  • 11