Skip to content

tadfmac/poorws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

poorws.js

This is a very simple WebSocket Client wrapper.

usage

initialization

<script src="js/poorws.js"></script>
var ws = new poorws("SERVER URL");

handle on connection status changed

ws.onStatusChange = function(status){
	$("#status").text(status);
};

send

$("#sendmes").click(function(){
	ws.send("testes");
});

onMessage

ws.onMessage = function(mes){
	var str = JSON.parse(mes.data);
	console.log(str);
};

That's all! Enjoy! :D

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published