From 22339275bbf384f40e2bf3b4b05f84b5b1201af3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 1 Jun 2018 09:17:18 +0000 Subject: [PATCH] enable forwarding of random domain --- telebitd.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/telebitd.js b/telebitd.js index a49150b..63a5139 100644 --- a/telebitd.js +++ b/telebitd.js @@ -251,15 +251,18 @@ module.exports.create = function (state) { token.dynamicPorts.push(serviceport); Devices.add(state.deviceLists, serviceport, token); var hri = require('human-readable-ids').hri; - var hrname = hri.random(); + var hrname = hri.random() + '.telebit.cloud'; + // TODO restrict to authenticated device + // TODO pull servername from config + Devices.add(state.deviceLists, hrname, token); sendTunnelMsg( null , [ 2 , 'grant' - , [ ['ssh+https', hrname + '.telebit.cloud', 443 ] + , [ ['ssh+https', hrname, 443 ] , ['ssh', 'ssh.telebit.cloud', serviceport ] , ['tcp', 'tcp.telebit.cloud', serviceport] - , ['https', hrname + '.telebit.cloud' ] + , ['https', hrname ] ] ] , 'control'