// const host = "jinnace.com" const host = glob_const.host const rname = "j1" function nop(){} var tglob = { gws:{sockets:{},}, twsfn:{ onmessage:nop, onclose:nop, onopen:nop, }, twsfn5:{ onmessage:nop, onclose:nop, onopen:nop, }, } var clog = nop function connect_ws_arg(o){ // console.trace("lxw") var vchatSocket var gws = tglob.gws // vchatSocket = gws[o.name] vchatSocket = gws.sockets[o.name] if (vchatSocket && vchatSocket.readyState < 2) { clog("VFB2 WSS ALLREADY CONNECTED!") return } clog("VFB2 WSS CONTECTING") vchatSocket = new WebSocket(o.url); // '/ws/chat/' + window.roomName + '/?qqAAAAAAAAAAAAAAAAA'); // window.vchatSocket =vchatSocket gws.sockets[o.name] = vchatSocket // var wsfn = gws[o.wsfn] var wsfn = o.wsfn vchatSocket.onmessage = wsfn.onmessage vchatSocket.onclose = wsfn.onclose vchatSocket.onopen = wsfn.onopen function connect_helper(){ var o = { // url:'wss://' + window.location.host + '/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA', // url:'wss://' + window.location.host + '/chat/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA', // url:'ws://' + window.location.host + '/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA', url:'wss://' + host + ':8943/ws/vts/' + rname + '/?qqAAAAAAAAAAAAAAAAA', // url:'wss://' + window.location.host + ':8943/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA', wsfn:twsfn, name:"ws_n1", } clog("o",o) connect_ws_arg(o) } function connect_helper5(){ var o = { // ':8943/ws/vts/' // url:'wss://' + window.location.host + '/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN', url:'wss://' + host + ':8943/ws/vts2/' + rname + '/?CONN', // url:'wss://' + window.location.host + ':8943/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN', wsfn:twsfn5, name:"ws_n15", } clog("o",o) connect_ws_arg(o) } connect_helper() connect_helper5()