Hi, i cant connect to my socket.io server in simulator, android, while i can connect succesfully using browser ( Chrome)
My setup :
Cocos Creator : 1.7
Browser : Chrome
Server : socket.io 2.0.4
In simulator and android, it automatically disconnect when i call connect. ( I can connect to ws://tools.itharbors.com:4000 )
In my socket.IO server , i see that the socket.handshake of browser and native platform is different :
==========Browser connect===============
{ headers:
{ host: '192.168.1.37:8113',
connection: 'keep-alive',
accept: '*/*',
origin: 'http://localhost:7456',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36',
referer: 'http://localhost:7456/',
'accept-encoding': 'gzip, deflate',
'accept-language': 'vi-VN,vi;q=0.9,en-US;q=0.8,en;q=0.7,fr-FR;q=0.6,fr;q=0
5,ja;q=0.4,de;q=0.3',
cookie: 'io=q8CuM0Vv8MZB-cRvAAAB' },
time: 'Thu Jan 04 2018 20:22:33 GMT+0700 (SE Asia Standard Time)',
address: '::ffff:192.168.1.36',
xdomain: true,
secure: false,
issued: 1515072153234,
url: '/socket.io/?token=6ad5f1be-53f2a858e7e48fee584c05&EIO=3&transport=polli
g&t=M31Leh6',
query:
{ token: '6ad5f1be-53f2a858e7e48fee584c05',
EIO: '3',
transport: 'polling',
t: 'M31Leh6' } }
==========Native connect===============
{ headers:
{ host: '192.168.1.37:8113',
accept: '*/*',
'accept-encoding': 'identity' },
time: 'Thu Jan 04 2018 20:23:08 GMT+0700 (SE Asia Standard Time)',
address: '::ffff:192.168.1.36',
xdomain: false,
secure: false,
issued: 1515072188157,
url: '/socket.io/1/?EIO=2&transport=polling&b64=true',
query: { EIO: '2', transport: 'polling', b64: 'true' } }