Permalink
Browse files

adds support for different hosts

  • Loading branch information...
1 parent 1266e0d commit dfacfc19008cf5d2efeaf12e18a08c735d01ae13 @videlalvaro committed May 15, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 priv/www/index.html
  2. +2 −2 priv/www/js/rmqws.js
View
2 priv/www/index.html
@@ -46,7 +46,7 @@
$(document).ready(function() {
var rmqws = new RabbitMQWs();
- rmqws.start();
+ rmqws.start(window.location.host);
$(rmqws).bind('rmqws-onconnection-status', function(event, status){
displayMessage("#info", status);
View
4 priv/www/js/rmqws.js
@@ -3,10 +3,10 @@ var RabbitMQWs = function() {
var that = {
ws: null,
- start: function() {
+ start: function(host) {
if ("WebSocket" in window) {
// browser supports websockets
- this.ws = new WebSocket("ws://" + window.location.host + "/service");
+ this.ws = new WebSocket("ws://" + host + "/service");
var that = this;
this.ws.onopen = function() {
// websocket is connected

0 comments on commit dfacfc1

Please sign in to comment.