Skip to content

Firehed/Websockets-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The client can connect to the server with javascript like the following:

var host = "ws://127.0.0.1:9000";
try {
	socket = new WebSocket(host);
	socket.onopen    = function(msg){ console.log("Connected"); };
	socket.onmessage = function(msg){ console.log(msg.data); };
	socket.onclose   = function(msg){ console.log("Disconnected"); };
}
catch(ex){ console.log(ex); }

Use socket.send('string'); to push data to the server. Look in ./app/Action.php to
handle the input the client sends. You could use some sort of auth system on the
first connection to tie a Client to your web app's users. Find something useful that
you can do with that knowledge :)

About

PHP-based server for html5 websockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages