Skip to content
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

Error trying to connect http server with socket.io #25

Open
ottopic opened this issue Mar 29, 2016 · 4 comments
Open

Error trying to connect http server with socket.io #25

ottopic opened this issue Mar 29, 2016 · 4 comments

Comments

@ottopic
Copy link

ottopic commented Mar 29, 2016

I'm trying to use that library but it get error when I try to connect with socket.io

[INFO] : error!"{"code":0,"message":"Transport unknown"}"
[INFO] : error!"HTTP error"

var io = require('socket.io'),
socket = io.connect(uri);

socket.on('connect', function (e) {
    Ti.API.log('connected!');
});


socket.on('error', function (e) {
    Ti.API.log('error!' + JSON.stringify(e));
});

How can help me?

@xChat
Copy link

xChat commented Mar 29, 2016

io('https://server.ip:1234', { transports: ['websocket'] });

Need to use websocket transport only.

Thanks.
On 30 Mar 2016 6:37 am, "Lorenzo" [email protected] wrote:

I'm trying to use that library but it get error when I try to connect with
socket.io

[INFO] : error!"{"code":0,"message":"Transport unknown"}"
[INFO] : error!"HTTP error"

var io = require('socket.io'),
socket = io.connect(uri);

socket.on('connect', function (e) {
Ti.API.log('connected!');
});

socket.on('error', function (e) {
Ti.API.log('error!' + JSON.stringify(e));
});

How can help me?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#25

@ottopic
Copy link
Author

ottopic commented Mar 29, 2016

https is required?

I tried with your reformatted socket.io. Can't find variable: OS_IOS. Where I can set the variable?

@xChat
Copy link

xChat commented Mar 30, 2016

You need to use the Alloy project template, otherwise just define your own
OS_IOS which just a boolen true if running on iOS, thanks.

Do the same for OS_ANDROID too.

On Wed, 30 Mar 2016 9:00 am Lorenzo [email protected] wrote:

https is required?

I tried with your reformatted socket.io. Can't find variable: OS_IOS.
Where I can set the variable?


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#25 (comment)

@MahmoudElmoghazy
Copy link

@xChat This option doesn't work the issue cause the versions did u find any solutions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants