main: add --remote-saving for limiting clients remote session saving rights

This commit is contained in:
jean-emmanuel 2019-01-04 13:11:23 +01:00
parent a4a2572973
commit 09debb5171
5 changed files with 12 additions and 2 deletions

View file

@ -6,11 +6,14 @@ var hearbeatInterval = 25000,
class Socket extends EventEmitter {
constructor(ws, id) {
constructor(ws, id, address) {
super()
this.id = id
this.address = address.indexOf('::ffff:') === 0 ? address.replace('::ffff:', '') : address
this.socket = null
this.sessionPath = ''

View file

@ -21,7 +21,7 @@ class Ipc extends EventEmitter {
if (!this.clients[id]) {
var client = new Client(socket, id)
var client = new Client(socket, id, req.connection.remoteAddress)
this.clients[id] = client
this.emit('connection', client)