Add a route to kill tunnel if open with same JWT token

This commit is contained in:
Olivier MICHAUD
2021-05-19 22:28:42 +02:00
parent 1371d03fec
commit 1204fdf99a
5 changed files with 117 additions and 12 deletions
+2 -1
View File
@@ -30,7 +30,7 @@ class ClientManager {
// create a new tunnel with `id`
// if the id is already used, a random id is assigned
// if the tunnel could not be created, throws an error
async newClient(id) {
async newClient(id, securityToken) {
const clients = this.clients;
const stats = this.stats;
@@ -49,6 +49,7 @@ class ClientManager {
const client = new Client({
id,
agent,
securityToken
});
// add to clients map immediately