allow different action cable host

This commit is contained in:
Zachary Chai
2017-02-16 10:29:08 -05:00
parent 82df7d209a
commit 74f1f4c071
4 changed files with 23 additions and 17 deletions

View File

@ -22,8 +22,13 @@
//= require_tree ./channels
(function() {
var protocol = window.location.protocol === "https:" ? "wss://" : "ws://";
var host = window.GreenLight.WEBSOCKET_HOST || window.location.host + window.GreenLight.RELATIVE_ROOT;
var path = window.GreenLight.WEBSOCKET_PATH || '/cable';
var url = protocol + host + path;
this.App || (this.App = {});
App.cable = ActionCable.createConsumer();
App.cable = ActionCable.createConsumer(url);
}).call(this);

View File

@ -47,8 +47,8 @@ class @Meeting
url = location.protocol + '//' + location.hostname
if location.port
url += ':' + location.port
if GreenLight.relative_root
url += GreenLight.relative_root
if GreenLight.RELATIVE_ROOT
url += GreenLight.RELATIVE_ROOT
return url
# Sends the end meeting request