var ip = "";
var ws = new WebSocket("ws://"+ip+":9998");
It is not possible to find private IP address. or I need any server side language like node.js?
You would need to know the IP address in order to do that. There is no way of figuring out the IP address of other clients. If you wanted to connect to another socket without knowing the IP address you would use a server to connect the endpoints and route the messages.