Skip to content

Commit 187a864

Browse files
committed
Update README.md
1 parent 0dc0465 commit 187a864

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ PHP and WebSockets
44

55
Quick hack to implement websockets in php. As of Feb/10 the only browsers that support websockets are Google Chrome and Webkit Nightlies. Get it from here http://www.google.com/chrome
66

7-
Browse the source code
8-
7+
###Browse the source code
8+
,,,js
99
Changelog
1010
010.02.16 - Added basic demo and chatbot
1111
010.02.16 - Added users list to keep track of handshakes
1212
010.02.16 - Organized everything in a reusable websocket class
1313
010.02.16 - Minor cosmetic changes
14-
Client side
14+
,,,
15+
###Client side
16+
,,,js
1517
var host = "ws://localhost:12345/websocket/server.php";
1618
try{
1719
socket = new WebSocket(host);
@@ -21,9 +23,11 @@ try{
2123
socket.onclose = function(msg){ log("Disconnected - status "+this.readyState); };
2224
}
2325
catch(ex){ log(ex); }
24-
View source code for the client
26+
,,,
27+
###View source code for the client
2528

26-
Server side
29+
###Server side
30+
,,,
2731
log("Handshaking...");
2832
list($resource,$host,$origin) = getheaders($buffer);
2933
$upgrade = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" .
@@ -34,7 +38,8 @@ $upgrade = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" .
3438
"\r\n";
3539
$handshake = true;
3640
socket_write($socket,$upgrade.chr(0),strlen($upgrade.chr(0)));
37-
View source code for the server
41+
,,,
42+
###View source code for the server
3843

3944
Steps to run the test:
4045
Save both files, client.php and server.php, in a folder in your local server running Apache and PHP.

0 commit comments

Comments
 (0)