How to connect to app server (Local Server via WebSocket?)

I am trying to connect to app server using javascript but it is not working.

 var ws = new WebSocket("wss://localhost:8443/websocket");
 ws.onopen = function()
 {
    ws.send("Message to send");
    alert("Message is sent...");
 };
 ws.onmessage = function (evt) 
 { 
    var received_msg = evt.data;
    alert("Message is received...");
 };
 ws.onclose = function()
 { 
    // websocket is closed.
    alert("Connection is closed..."); 
 };

Sorry, but I am not entirely sure what you are trying to do… it looks like you might have a Local Server and are trying to access it with a RPi of some sort?

My best guess, until someone else recognises what you are trying, is that you may have a bad port setting? There were changes made not too long ago:

I want to connect to tcp-app-server.The version I am using of blynk server is ok because blynk own android app is sending a request to same port “8443” so there is no issue with port I think.

Sorry but I am still a bit confused as to what exactly you are trying to do… But I will take another guess :wink:

If you already have a local server, and are trying to connect to it from an RPi running Blynk client, then the command I think you are looking for will be like this:

var blynk = new Blynk.Blynk(AUTH, options = { connector : new Blynk.TcpClient( options = { addr:"xxx.xxx.xxx.xxx", port:8442 } ) });

That is how how I do it with my Local Server and RPi client:

If however, you are trying to do something totally different… then I think we will both have to wait for someone else to answer :wink:

I want to develop my on application and want to use blynk server as backend. now the problem is that all other rest ends are working fine, but I want to register user now through my application rather then using blynk andriod app how can I do this.