for ti-stats-hook and YaTriple
Do not use for product.
- Boot WebSocket server
- Boot Titanium app
- Send Titanium JavaScript code from WebSocket server
node.js WebSocket server example. See test_server.
var WebSocketServer = require('ws').Server,
wss = new WebSocketServer({
port: 8888
});
wss.on('connection', function(ws){
ws.send('var win = Ti.UI.createWindow({backgroundColor:"#000"}); win.open(); setTimeout(function(){win.backgroundColor = "#f00";}, 1000)');
});
See test_app.
- Install the this module
- Writing
<property name="evaluate-host" type="string">ws://localhost:8888</property>
in tiapp.xml - Build!