cocos2d / cocos2d-js

cocos2d-x for JS
http://www.cocos2d-x.org
MIT License
1.86k stars 490 forks source link

secure websocket connection doesn't work #725

Open MQuy opened 10 years ago

MQuy commented 10 years ago

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?

zhaijialong commented 10 years ago

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

zhaijialong commented 10 years ago

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

alex-mcleod commented 10 years ago

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

zhaijialong commented 10 years ago

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.

alex-mcleod commented 10 years ago

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.

zhaijialong commented 10 years ago

Sorry I have no idea about that now.

alex-mcleod commented 10 years ago

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

livelite commented 8 years ago

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