How to use the websocket.WebSocket function in websocket

To help you get started, we’ve selected a few websocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github odooku / odooku / odooku_addons / websocket / static / src / js / session.js View on Github external
setup: function() {
      this._super.apply(this, arguments);
      if (websocket.ws) websocket.ws.destroy();
      var uri = this.origin.replace('http://', 'ws://').replace('https://', 'wss://');
      if (odoo.debug) {
        uri += '?debug=' + $.deparam($.param.querystring()).debug;
      }
      websocket.ws = new WebSocket(uri);
    }
  });
github odooku / odooku / odooku_addons / websocket / static / src / js / session.js View on Github external
setup: function() {
      this._super.apply(this, arguments);
      if (this.ws) this.ws.destroy();
      var uri = this.origin.replace('http://', 'ws://').replace('https://', 'wss://');
      this.ws = new WebSocket(uri);
    },