1) Yes.
2) Creating two separated websockets. They will be different objects though.
You could blend both objects in a composite object like this:
var compositeWebSocket = function(urlSend, urlReceive){
var me = {};
var wsSend = new WebSocket(urlSend);
var wsReceive = new WebSocket(urlReceive);
var open = 0;
wsSend.onopen = opening;
wsReceive.onopen = opening;
var opening = function(){
if(open == 2){
if(me.onopen)
me.onopen();
}
else
open++;
};
var closing = funcion(){
try{wsSend.close();}catch(){}
try{wsReceive.close();}catch(){}
if(me.onclose)
me.onclose();
}
me.send = wsSend.send;
wsReceive.onmessage = function(msg){
if(me.onmessage)
me.onmessage(msg);
}
return me;
}
(Whatch out, this code is not tested and it is just an idea)