Skip to content

greentornado/ti-websocket-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSocket client for Titanium Mobile

It's implementation of WebSocket client for Titanium Mobile.

Supported protocols

How to use it

copy "ti-websocket-client.js" to your app Resources directory.

var WebSocket = require('ti-websocket-client').WebSocket;

ws = new WebSocket("ws://localhost:3000/");

ws.onopen = function () {
	alert("Connected");
	ws.send("Hello");
};

ws.onclose = function () {
	alert("Disconnected");
};

ws.onmessage = function (message) {
	alert("> "+message.data);
};

ws.onerror = function (e) {
	alert('Error: ' + (e ? JSON.stringify(e) : 'A unknown error occurred'));
};

Working

  • Working for Socket.IO. I'll make for Socket.IO soon.
  • Supported iOS only, I'm waiting a patch from you.

License

MIT License. Copyright 2011 Yuichiro MASUI masui@masuidrive.jp

About

WebSocket client for Titanium Mobile 1.7.x+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published