Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding relay port #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/hypertunnel/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 = `
Expand Down
3 changes: 2 additions & 1 deletion packages/hypertunnel/lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand All @@ -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

Expand Down