Skip to content

Commit

Permalink
path option
Browse files Browse the repository at this point in the history
  • Loading branch information
vshymanskyy committed Feb 6, 2017
1 parent 7f31c38 commit b5c6e3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blynk-browser.js
Expand Up @@ -27,6 +27,7 @@ exports.WsClient = function(options) {
var options = options || {};
self.addr = options.addr || "blynk-cloud.com";
self.port = options.port || 8082;
self.path = options.path || "/websockets";

this.write = function(data) {
if (self.sock) {
Expand All @@ -39,7 +40,7 @@ exports.WsClient = function(options) {
self.sock.close();
}
try {
self.sock = new WebSocket('ws://' + self.addr + ':' + self.port + '/websockets');
self.sock = new WebSocket('ws://' + self.addr + ':' + self.port + options.path);
self.sock.binaryType = 'arraybuffer';
self.sock.onopen = function(evt) { done() };
self.sock.onclose = function(evt) { self.emit('end'); };
Expand Down

0 comments on commit b5c6e3a

Please sign in to comment.