From d2e8509c626188f055cbde65d7d8215eca36af77 Mon Sep 17 00:00:00 2001 From: Shu Song Date: Fri, 6 Sep 2019 12:37:06 -0400 Subject: [PATCH 1/2] adding relay port --- packages/hypertunnel/cli.js | 4 +++- packages/hypertunnel/lib/Client.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/hypertunnel/cli.js b/packages/hypertunnel/cli.js index 2068f90..101ea86 100755 --- a/packages/hypertunnel/cli.js +++ b/packages/hypertunnel/cli.js @@ -16,6 +16,7 @@ module.exports = async (argv) => { .option('-s, --server [server]', 'hypertunnel server to use', 'https://hypertunnel.ga') .option('-t, --token [token]', 'token required by the server', 'free-server-please-be-nice') .option('-i, --internet-port [port]', 'the desired internet port on the public server', parseInt) + .option('-r, --relay-port [port]', 'the desired relay port on the public server', parseInt) .option('--ssl', 'enable SSL termination (https://) on the public server') .parse(argv) @@ -41,7 +42,8 @@ module.exports = async (argv) => { host: program.localhost, server: program.server, token: program.token, - internetPort: program.internetPort + internetPort: program.internetPort, + relayPort: program.relayPort }, { ssl: program.ssl }) await client.create() let message = ` diff --git a/packages/hypertunnel/lib/Client.js b/packages/hypertunnel/lib/Client.js index 45363ed..a517a13 100644 --- a/packages/hypertunnel/lib/Client.js +++ b/packages/hypertunnel/lib/Client.js @@ -22,7 +22,7 @@ class Client { this.deleted = false this.relay = null this.internetPort = null - this.relayPort = null + this.relayPort = opts.relayPort || null this.uri = null this.secret = null this.createdAt = null @@ -36,6 +36,7 @@ class Client { const payload = { serverToken: this.token, internetPort: this.desiredInternetPort, + relayPort: this.relayPort, ssl: this.options.ssl } debug('create payload', payload) From 1854042d8ebe3573b706711b4d91b31cdfc3d16d Mon Sep 17 00:00:00 2001 From: Shu Song Date: Fri, 6 Sep 2019 12:43:33 -0400 Subject: [PATCH 2/2] changing readme --- readme.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index d1f7854..47bc59e 100644 --- a/readme.md +++ b/readme.md @@ -34,7 +34,8 @@ This free TCP relay/reverse proxy service can be used to **expose any TCP/IP ser -s, --server [server] hypertunnel server to use (default: https://hypertunnel.ga) -t, --token [token] token required by the server (default: free-server-please-be-nice) -i, --internet-port [port] the desired internet port on the public server - --ssl enable SSL termination (https://) on the public server + -r, --relay-port [port] the desired relay port on the public server + --ssl enable SSL termination (https://) on the public server -h, --help output usage information ``` @@ -169,7 +170,7 @@ Enter username: You are now bob ## Comparison to localtunnel/ngrok -Both are great services! +Both are great services! If your use-case is to simply tunnel local http web server traffic I suggest using them. :-) I ran into issues when trying to expose a local proxy server (to use the client as forwarding proxy). Both services need to inspect and rewrite HTTP headers for routing, so using the tunnel as a proxy in e.g. Chrome won't work. There are a couple other use-cases where raw TCP stream tunnelling is desired and hypertunnel is the only available option. @@ -207,7 +208,7 @@ Given that there is no alternative to hypertunnel I figured I'd rather release i ## Contributing -Contributions are welcome. +Contributions are welcome. We use a [monorepo](https://github.com/berstend/hypertunnel) powered by [Lerna](https://github.com/lerna/lerna#--use-workspaces) (and yarn workspaces), [ava](https://github.com/avajs/ava) for testing and the [standard](https://standardjs.com/) style for linting. @@ -218,7 +219,7 @@ We use a [monorepo](https://github.com/berstend/hypertunnel) powered by [Lerna]( # Make sure you have a recent version of yarn & lerna installed: npm install -g yarn lerna -# Bootstrap the packages in the current Lerna repo. +# Bootstrap the packages in the current Lerna repo. # Installs all of their dependencies and links any cross-dependencies. yarn bootstrap