-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility Socket.io 1.0 #9
Comments
We at @smclab are working on this. Please watch this repository or this thread to get updates! |
Amazing news :) Sent from my iPhone
|
The idea is to be able to do the following
var io = require('socket.io');
var socket = io('url');
socket.on('message', function (data) {
Ti.API.info(data);
}); :) |
Any news or help wanted? |
@HilkoLantinga Our titaniumifier is almost 1.0.0, with it we’ll have full gitTio integration, so once it’s out we’ll start working on In case, would you be interested in helping us? |
Of course as I'd love to finally get rid of 0.9.16 in my own software, but I must say I failed miserably with my previous attempt on 1.0.x of socket.io even with the help of Guillermo. It was like staring in to the abyss, I got to the point that no more errors occurred, but it also wouldn't connect and I was totally clueless of why. Guillermo was and probably still is interested of supporting Titanium so make sure to ask him as well when you have an issue that you can't work out. edit: This is what I had with my last version (attempting 1.0.4 at the time): And my explanation of the diffs for Titanium to Guillermo: Here you can see the main changes that needed to be made with 0.9.x: http://www.diffnow.com/?report=psxmb At the moment I'm thinking of an extra make file in socket.io-client that creates a titanium/socket.io.js which does not use browserify but uses require with adjusted paths and maybe does not use engine.io, but the WebSocket directly. Two options Guillermo mentioned would be replacing engine.io with an alternative that only uses tiws or add a JSON long poll transport using Titanium.Network.createHTTPClient to engine.io. I only went for the first as I'm pretty biased towards websockets, however I must admit that not having to use modules (SocketRocket/Android-WebSocket) is appealing as well as it would make maintenance between IOS and Titanium updates virtually non existent and would make it a lot easier for people to use. |
Can any one help in How to call TCP URL from "socket.io.js" from IOS in Titanium ?? |
Titaniumifier reached v1.0.0, and gitTio is integrated, so we’ll start working on this shortly. @HilkoLantinga thank you so much for this valuable info. I’ll get in touch asap with the roadmap. Drop me a line on twitter ( |
@ravivarma434 sorry, by now I have no idea. |
@yuchi Thanks, Any body Please help me in this issue. |
I've been using socket io 1.2.0 on Android (with tiws). If it helps, here is a gist with a patched socket.io and a diff from vanilla socket io: There are shortcomings (though at the moment, they are not relevant for my usage):
io('https://server.ip:1111', { transports: ["websocket"] });
|
I know nothing of native modules, but what suprises me is that I only see nsstring in tiws, shouldn't it also use nsdata and buffer for when the server returns binary? |
@HilkoLantinga Actually the current version of TiWS for iOS only supports string data. Supporting binary is doable, but it requires some more work. I'll try looking into that |
Regarding compatibility with vanilla socket.io or any other third party JS lib, my plan would be to first make the API compatible with browser's websockets through a pure JS wrapper (see issue #15), and implement missing features (e.g. readyState, etc). Ideally, the final step would be to implement @yuchi's vision through Titaniumifier |
Any news about this threat? |
If someone is interested we have a customer that would be willing to pay someone to update this module to work with socket.io 1.0 . If you know of anyone interested please let me know. |
Has there been any update in regards to socket.io 1.0? |
i have spent more than an hour searching for the socket io client for 1.x |
@yuchi any news about |
Check it out the gist of @ndob in : https://gist.github.com/ndob/4742514cd23eec7a81a3 applying change in last comment run in Android and iOS, I running my app with SocketIO 1.3.7 on server! Enjoy! |
@celsoperezcruz 👍 👍 👍 Thanks man! |
Awesome guys! Based on @ndob 's work, here is the latest: |
Hi, How are you... This is not working for me it sends: [ERROR] : Script Error { Can any one help me... Thanks |
wow 1.4.5 ? You're sure this work for both ? server and client side |
@DouglasHennrich Ye, using it with a v1.4.5 server on the node server side, both iOS and Android working fine for me at the moment. It's for titanium / appcelerator projects though. |
greeat I will copy your socket file :D Thanks |
@xChat i have try your code on titanium project and says Can't find variable: document. Can you send me your titanium implementation example so i can make it work. It looks like the error is because there is no web ambient on the titanium and can not find the document variable. i am using tiws module and the socket io file you post. Thanks for your help. |
@jvega2k Hi, you will have to use the websocket protocol with tiws module. eg. The second parameter is a must. Please keep me posted. Thanks. |
socket = io.connect("http://localhost:5000", {
'transports' : [ 'websocket' ],
'reconnect' : true,
'reconnect delay' : 100,
'reconnect limit' : 5000,
'multiplex': true,
'max reconnection attempts' : Infinity,
'query': 'user_id=' + Alloy.User.user_id
}); |
how can I do to the user always get the same socket or eliminate the previous socket when he reconnect ? |
This should be in a socket.io thread? haha |
Hi @xChat , I have same problem with this library, do you have an appcelerator implementation example to help me? |
@ottopic what had you try the examples above? There is any error on your try? |
@yagitoshiro has new news :) |
Hi guys, please help... I want to use TiWS with extra headers authentication(token), but no luck so far, server returns error 400. Have you somebody implemented this? Thanks |
How are you doing this? I be able to implement JWT |
Hi Douglas, };
|
And you confirm that you're getting this |
Server returns me error: |
try the jwt as I said maybe it works for your case |
Can you please help me ho to integrate jwt to appcelerator project? edit: I talked to my boss and he told me, that jwt won't work. Only option to authenticate is send token in header. |
Can't you create a event to be emitted passing this token? if it's invalid, disconnect the socket, otherwise continue with your code |
I can't pass it in emit(because of the rules), it has to be in headers... |
Did you tried to put Looking into socket.io lib, it has this |
Can you use thorugh
|
also, how you're getting and validating this header on your server? I guess I will move to this approach too |
There is a way to make this module compatible with the new version socket io 1.0?
The text was updated successfully, but these errors were encountered: