From 05dd6d90e67fd35692e2b25f15d8a5c8d22cafee Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 14 Jun 2018 17:05:26 -0600 Subject: [PATCH] sign token with ports --- bin/telebitd.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index 399aa73..070e71d 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -28,7 +28,7 @@ if (-1 !== confIndex) { confpath = confargs[1]; } -var updater = require('../lib/updater')(pkg); +require('../lib/updater')(pkg); function help() { console.info(''); @@ -646,7 +646,13 @@ function rawTunnel() { if (!state.config.token && state.config.secret) { var jwt = require('jsonwebtoken'); var tokenData = { - domains: Object.keys(state.config.servernames || {}).filter(function (name) { return /\./.test(name); }) + domains: Object.keys(state.config.servernames || {}).filter(function (name) { + return /\./.test(name); + }) + , ports: Object.keys(state.config.ports || {}).filter(function (port) { + port = parseInt(port, 10); + return port > 0 && port <= 65535; + }) , aud: aud , iss: Math.round(Date.now() / 1000) };