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

secure websocket connection doesn't work

Open MQuy opened this issue 10 years ago • 8 comments

I try to secure websocket connection via modify WebSocketTest in js-tests ws://echo.websocket.org => wss://echo.websocket.org. I compile with original test ws://echo.websocket.org and install on android simulator 4.3. Everything works well. But compiling with wss://echo.websocket.org, it fires error and can't connect to server. Is there any missing config when making secure connection?

MQuy avatar Aug 25 '14 01:08 MQuy

Thanks for your report.That does not work. I will check it later.

zhaijialong avatar Aug 25 '14 12:08 zhaijialong

If you have fixed it, a pull request will be so nice. Thank you. :)

zhaijialong avatar Aug 25 '14 12:08 zhaijialong

Has anyone managed to get secure web sockets working? I'm attempting to integrate Firebase into my game and it requires WSS.

alex-mcleod avatar Sep 14 '14 14:09 alex-mcleod

The libwebsockets in Cocos2d-JS(actually comes from Cocos2d-x) is prebuilt without OpenSSL support, so it does not work with wss. You can try to built it with OpenSSL yourself. An potential problem is that the libcurl is static linked with OpenSSL too, so maybe it will cause the problem of redefining symbols.

zhaijialong avatar Sep 15 '14 02:09 zhaijialong

Yeah I realised that after asking last night. Do you know if there are instructions anywhere on compiling libwebsockets for iOS and Android? I have been trying all day to get it working but so far it has been relatively painful.

alex-mcleod avatar Sep 15 '14 02:09 alex-mcleod

Sorry I have no idea about that now.

zhaijialong avatar Sep 15 '14 02:09 zhaijialong

No worries. I'll keep plugging away and see how I go.

alex-mcleod avatar Sep 15 '14 02:09 alex-mcleod

Firebase is great. It makes multiplayer games very easy. I would also love to see the support of it in cocos2d-js.

livelite avatar Nov 09 '15 19:11 livelite