cocos2d-js icon indicating copy to clipboard operation
cocos2d-js copied to clipboard

Does jsb support socket.io now?

Open IgorMats opened this issue 9 years ago • 7 comments

I saw some thread at the forum on December but what now? Is something changes? Unfortunately I'm don't find any information about this. I thinks support of socket.io is very important feature.

IgorMats avatar Oct 29 '14 20:10 IgorMats

Yes, jsb supports socket.io. There is a sample in /js-tests/src/ExtensionsTest/NetworkTest/SocketIOTest.js

zhaijialong avatar Oct 30 '14 02:10 zhaijialong

Thanks @joshuastray! var SocketIO = SocketIO || window.io; and external require was a little confusing :)

IgorMats avatar Oct 30 '14 12:10 IgorMats

@joshuastray how about secure option? I see that if my socket.io server running with SSL cetificates e. g. secure connection over https Cocos2d-JS Android app can't connect to him (Cocos2d-HTML5 can). This is very important thing. Tell me please where I can check it. Thanks.

IgorMats avatar Oct 30 '14 16:10 IgorMats

Yes, it is a known issue. The libwebsockets in frameworks/js-bindings/cocos2d-x/external is built without OpenSSL support. Websockets in JSB also can't connect to wss. https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/issues/27

zhaijialong avatar Oct 30 '14 16:10 zhaijialong

@Joshuastray it's a very big issue. It's mean that my players from secure page can't play online with mobile players :(

I need to do some research hot to fix this.

IgorMats avatar Oct 30 '14 16:10 IgorMats

@IgorMats Yes, I agree with you. Seems that they met problems when builing libwebsockets linked with OpenSSL. I am not sure about that, looking forward to your good news. Thank you!

The prebuilt libwebsockets comes from here:https://github.com/dumganhar/libwebsockets/tree/v1.23 Hopes that can help you.

zhaijialong avatar Oct 30 '14 18:10 zhaijialong

I know this is a very old question, but is there any update on this please? I am having the same issue that my game can not connect to a secure url via socketIO on mobile. it works fine on web.

huangmr avatar May 05 '17 20:05 huangmr