tiws icon indicating copy to clipboard operation
tiws copied to clipboard

Error trying to connect http server with socket.io

Open ottopic opened this issue 8 years ago • 4 comments

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?

ottopic avatar Mar 29 '16 19:03 ottopic

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 https://github.com/omorandi/tiws/issues/25

xChat avatar Mar 29 '16 21:03 xChat

https is required?

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

ottopic avatar Mar 29 '16 22:03 ottopic

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 https://github.com/omorandi/tiws/issues/25#issuecomment-203130436

xChat avatar Mar 30 '16 23:03 xChat

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

MahmoudElmoghazy avatar Oct 01 '17 10:10 MahmoudElmoghazy