I made a little modification to yours on https://www.sanwebe.com/2013/05/chat-using-websocket-php-socket. Thanks for it. It successfully worked at first for the localhost on XAMPP. It was great. But, it was blocked on a remote server nested in WHOIS.COM, a major hosting company. All failed!!! 1. Browser: Chrome, Firefox 2. Hosting Company: WHOIS.COM 3. Service Plan: VPS 4. Tried IPs: 80, 8080, 2028 5. Tried Hosts: localhost, teagege.com:2028, 132.131.312.23:2028 6. domain ip:132.131.312.23:2028 (not on service now) 7. domain:teagege.com:2028
Please see what's wrong!
var n = 'ws://localhost:80/ph/server.php'; socket = new WebSocket(n);
$host = 'localhost'; $port = 80; $socketpath = 'ph/server.php'; ...... $sob = socket_bind($socket, '0.0.0.0', $port); ...... "WebSocket-Origin: $host/rn" . "WebSocket-Location: ws://$host:$port/$socketpath/rn".
I want to get through this problem even if I got a detour with another easy source code from echo.websocket.org.