From 846590e648c23cf19c3e7660366e47fc119415e0 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 1 Jun 2018 09:04:58 +0000 Subject: [PATCH] grant tcp, ssh, and https by default --- package.json | 1 + telebitd.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c207fe8..6282c14 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "cluster-store": "^2.0.8", "finalhandler": "^1.1.1", "greenlock": "^2.2.4", + "human-readable-ids": "^1.0.4", "js-yaml": "^3.11.0", "jsonwebtoken": "^8.2.1", "proxy-packer": "^1.4.3", diff --git a/telebitd.js b/telebitd.js index bbfd707..9f99e5a 100644 --- a/telebitd.js +++ b/telebitd.js @@ -250,12 +250,14 @@ module.exports.create = function (state) { console.info('[DynTcpConn] Port', serviceport, 'now open for', token.deviceId); token.dynamicPorts.push(serviceport); Devices.add(state.deviceLists, serviceport, token); + var hri = require('human-readable-ids').hri; sendTunnelMsg( null , [ 2 , 'grant' - , [ ['tcp', serviceport] - , ['https', 'ssh.test.telebit.cloud' ] + , [ ['tcp', 'tcp.telebit.cloud', serviceport] + , ['ssh', 'ssh.telebit.cloud', serviceport ] + , ['https', hri.random() + '.telebit.cloud' ] ] ] , 'control'