You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // const host = "jinnace.com"
  2. const host = glob_const.host
  3. const rname = "j1"
  4. function nop(){}
  5. var tglob = {
  6. gws:{sockets:{},},
  7. twsfn:{
  8. onmessage:nop,
  9. onclose:nop,
  10. onopen:nop,
  11. },
  12. twsfn5:{
  13. onmessage:nop,
  14. onclose:nop,
  15. onopen:nop,
  16. },
  17. }
  18. var clog = nop
  19. function connect_ws_arg(o){
  20. // console.trace("lxw")
  21. var vchatSocket
  22. var gws = tglob.gws
  23. // vchatSocket = gws[o.name]
  24. vchatSocket = gws.sockets[o.name]
  25. if (vchatSocket && vchatSocket.readyState < 2) {
  26. clog("VFB2 WSS ALLREADY CONNECTED!")
  27. return
  28. }
  29. clog("VFB2 WSS CONTECTING")
  30. vchatSocket = new WebSocket(o.url);
  31. // '/ws/chat/' + window.roomName + '/?qqAAAAAAAAAAAAAAAAA');
  32. // window.vchatSocket =vchatSocket
  33. gws.sockets[o.name] = vchatSocket
  34. // var wsfn = gws[o.wsfn]
  35. var wsfn = o.wsfn
  36. vchatSocket.onmessage = wsfn.onmessage
  37. vchatSocket.onclose = wsfn.onclose
  38. vchatSocket.onopen = wsfn.onopen
  39. function connect_helper(){
  40. var o = {
  41. // url:'wss://' + window.location.host + '/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA',
  42. // url:'wss://' + window.location.host + '/chat/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA',
  43. // url:'ws://' + window.location.host + '/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA',
  44. url:'wss://' + host + ':8943/ws/vts/' + rname + '/?qqAAAAAAAAAAAAAAAAA',
  45. // url:'wss://' + window.location.host + ':8943/ws/vts/' + window.roomName.toLowerCase() + '/?qqAAAAAAAAAAAAAAAAA',
  46. wsfn:twsfn,
  47. name:"ws_n1",
  48. }
  49. clog("o",o)
  50. connect_ws_arg(o)
  51. }
  52. function connect_helper5(){
  53. var o = {
  54. // ':8943/ws/vts/'
  55. // url:'wss://' + window.location.host + '/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
  56. url:'wss://' + host + ':8943/ws/vts2/' + rname + '/?CONN',
  57. // url:'wss://' + window.location.host + ':8943/ws/vts2/' + window.roomName.toLowerCase() + '/?CONN',
  58. wsfn:twsfn5,
  59. name:"ws_n15",
  60. }
  61. clog("o",o)
  62. connect_ws_arg(o)
  63. }
  64. connect_helper()
  65. connect_helper5()