diff --git a/packages/browser-sync/lib/sockets.ts b/packages/browser-sync/lib/sockets.ts index 8af52ab9..33892c34 100644 --- a/packages/browser-sync/lib/sockets.ts +++ b/packages/browser-sync/lib/sockets.ts @@ -62,7 +62,15 @@ export function init(server, clientEvents, bs) { client.emit("connection", bs.options.toJS()); //todo - trim the amount of options sent to clients emitter.emit("client:connected", { - ua: client.handshake.headers["user-agent"] + ua: client.handshake.headers["user-agent"], + ip: client.handshake.address + }); + + client.on("disconnect", function() { + emitter.emit("client:disconnected", { + ua: client.handshake.headers["user-agent"], + ip: client.handshake.address + }); }); }