Skip to content

Commit 69c33cf

Browse files
committed
Pass options into Client
1 parent 3f220b6 commit 69c33cf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/client.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ var WebSocket = require('faye-websocket');
55

66
module.exports = Client;
77

8-
function Client(req, socket, head) {
8+
function Client(req, socket, head, options) {
9+
options = this.options = options || {};
910
this.ws = new WebSocket(req, socket, head);
1011
this.ws.onmessage = this.message.bind(this);
1112
this.ws.onclose = this.close.bind(this);
@@ -54,8 +55,9 @@ Client.prototype.reload = function reload(files) {
5455
this.send({
5556
command: 'reload',
5657
path: file,
57-
liveCss: true,
58-
liveJs: true
58+
liveCss: this.options.liveCss !== false,
59+
liveJs: this.options.liveJs !== false,
60+
liveImg: this.options.liveImg !== false
5961
});
6062
}, this);
6163
};

lib/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Server.prototype.handle = function handle(req, res, next) {
118118

119119
Server.prototype.websocketify = function websocketify(req, socket, head) {
120120
var self = this;
121-
var client = new Client(req, socket, head);
121+
var client = new Client(req, socket, head, this.options);
122122
this.clients[client.id] = client;
123123

124124
debug('New LiveReload connection (id: %s)', client.id);

0 commit comments

Comments
 (0)