Skip to content

Commit

Permalink
Assume the MQTT server is on the same host as is serving the file
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Maclean committed Jun 2, 2015
1 parent ff224a2 commit 7f6836f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var mqtt = require('mqtt');
var React = require('react');
var client = mqtt.connect("ws://localhost:1884");

var host = 'ws://' + window.location.host + ':1884';
var client = mqtt.connect(host);

client.on('connect', function() {
client.subscribe("haw");
Expand Down

0 comments on commit 7f6836f

Please sign in to comment.