oi.tekcos - wraps socket.io to really work on all browsers using get-jsonp
what it does?
'takes' over socket.io client side emitting and transfers it using jQuery $.ajax get jsonp
install oi.tekcos using npm
npm install -g oi.tekcos
server side usage:
// returns the same object like require('socket.io').listen(1337) io = require('oi.tekcos').listen(1337)
client side usage:
<script src="/socket.io/socket.io.js"></script> <script src="/oi.tekcos/oi.tekcos.js"></script> <script> // just like socket.io... so readup at http://socket.io/ var socket = io.connect('http://localhost:1337'); </script>
why you ask?
because already wrote a project using socket.io (and loving it!) but for my misfourten the mobile client that my organization uses is a lame Nokia E72 w/ SymbianOS, that from some reason stopped reciving and emiting events after a couple of client side emits (client emits server). i noticed that when i only recive events (server emiting client) it works fine. so i did this workaround using jQuery $.ajax call that maps to an express server. the server get those 'get jsonp' requests and then routes it to the socket.io interface and returns a response to the client (a callback function, just like the socket.io api) . yes. its shite... but i tried to be as clean as possible.
more info will come in the future...