put id in path

This commit is contained in:
DESKTOP-0P848CA\edinl_6z7c6t
2021-11-20 09:01:07 +08:00
parent 78c06f8fc4
commit 6de9845556
18 changed files with 4879 additions and 1201 deletions
+5 -10
View File
@@ -1,8 +1,5 @@
import { hri } from 'human-readable-ids';
import Debug from 'debug';
import Client from './Client';
import TunnelAgent from './TunnelAgent';
const Client = require('./Client');
const TunnelAgent = require('./TunnelAgent');
// Manage sets of clients
//
@@ -19,8 +16,6 @@ class ClientManager {
tunnels: 0
};
this.debug = Debug('lt:ClientManager');
// This is totally wrong :facepalm: this needs to be per-client...
this.graceTimeout = null;
}
@@ -34,7 +29,7 @@ class ClientManager {
// can't ask for id already is use
if (clients[id]) {
id = hri.random();
return;
}
const maxSockets = this.opt.max_tcp_sockets;
@@ -74,7 +69,7 @@ class ClientManager {
}
removeClient(id) {
this.debug('removing client: %s', id);
console.debug('removing client: %s', id)
const client = this.clients[id];
if (!client) {
return;
@@ -93,4 +88,4 @@ class ClientManager {
}
}
export default ClientManager;
module.exports = ClientManager;