언어 설정

Menu
Sites
Language
Unable to connect to websocket server on wearable emulator

Hello!

I'm new to Tizen and want to develop an app for Samsung Gear S which makes use of websockets. I have created a WebSocket server via NodeJS and run it on my machine. I can connect to this server using various tools, but not on emulator. 

To connect to my server I used code from here: http://download.tizen.org/misc/examples/w3c_html5/communication/the_websocket_api/web_socket.htm

All I see in logs is: index.html (40) :current readyState : 3

As I understand, emulator is unable to connect to my server. Any hints on how I can achieve that? Source lines I use to connect: 

 

        var webSocketURL = "wss://localhost:5000";

        var webSocket = new WebSocket(webSocketURL);

 

 

Responses

4 댓글
daniel kim

Hi,

I would suggest you to check below privilege and policy in your config.xml as  it's required.

    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <access origin="*" subdomains="true"/>

Regards

AVSukhov

Hello,

Try to use your local IP instead localhost: "ws://localIP:8080" instead "ws://localhost:8080"

Anton B

I do have the following in my config.xml

Was trying to use different addresses for sever: my computer local IP address - no luck so far

Phil rzr