I made a websocket demo (phpserver) and websocketdemo. I made a websocket demo (phpserver), websocketdemonotice: execute php files such as php-qc: pathserver through the command line. php accesses 127.0.0.1web through a local web server. a websocket demo (php server) and websocketdemo are developed by me.
Notice:
Execute the php file through the command line, such as php-q c: \ path \ server. php.
Access http: // 127.0.0.1/websocket/index. php through a local web server.
Notice:
Php5.3 or above is required, and a web server such as apache
The browser must support html5 web socket
Listen to socket port 9505 here. if the port is occupied, you may need to modify the port or kill the corresponding port process in the two files.
The mobile phone on the page looks better than on the pc!
1. client code html file
1. client code: Chatdemo
Simple chat demo
Send