Closed sarfraznawaz2005 closed 7 years ago
Hi Sarfraz Ahmed, i looked at your code, and the problem in connecting to js. You need to specify the route that uses your socket and port
var socket = new WebSocket("ws://localhost:8080/socket");
Write it and everything will be fine
@tabuna Awesome thanks it works now :)
Hi, It is not working for me. It is showing the "Connection Established" alert but in chrome console its throwing exception
socket.html:110 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
Please give me some suggestion on the same
I am getting errors establishing connection, this is what i have done:
JS:
Started server (php artisan socket:serve) Laravel web socket server started on localhost:8080/address:127.0.0.1
Route:
But Iam getting erorrs like:
WebSocket connection to 'ws://localhost/' failed: Error during WebSocket handshake: Unexpected response code: 200
Broken connections Key: 1006 cause:
Any ideas plz ?