Skip to content

LazeMSS/tunnelout

 
 

Repository files navigation

tunnelout

TunnelOut is a small nodejs appliaction that can expose a locally internal web server to the public web. Its based on https://github.com/localtunnel/localtunnel

TunnelOut makes it easy for you to expose you local rpi website, offer public apis and more.

Quickstart

npx tunnelout --port 8000 --host https://servername.com

Installation

Globally

npm install -g tunnelout

As a dependency in your project

npm install tunnelout

CLI usage

When localtunnel is installed globally, just use the tunout command to start the tunnel.

tunout --port 8000 --host https://servername.com

Thats it! It will connect to the tunnel server, setup the tunnel, and tell you what url to use for your testing. This url will remain active for the duration of your session; so feel free to share it with others for happy fun time! You can add the --print-request to get realtime preview of what files are being served out.

You can restart your local server all you want, tunout is smart enough to detect this and reconnect once it is back.

Usage

Usage: tunout --host <tunnelOutHost> --port <number> [options]

Options:
  -d, --debug                  output extra debugging (default: false, env: DEBUG)
  -h, --host <tunnelOutHost>   tunnelOut server providing forwarding - remember http(s):// (env: HOST)
  -p, --port <number>          local port number to connect to ie. --local-host:--port (default: 80, env: PORT)
  -r, --retries <number>       Maxium number of retries before giving up on the connection, 0 means no limit (default: 10, env: RETRIES)
  -i, --insecurehost           Use/force insecure tunnel when connecting to the tunnelOut server (default: false, env: INSECUREHOST)
  -k, --clientkey <clientkey>  Send this string as client key header to the tunnelOut server (env: CLIENTKEY)
  -s, --subdomain <domain>     Send then string as the requested subdomain on the tunnelOut server (env: SUBDOMAIN)
  -l, --local-host <host>      Tunnel traffic to this host instead of localhost, override Host header to this host (default: "localhost", env: LOCALHOST)
  -q, --quiet                  quiet mode - minimal output to the shell (default: false, env: QUIET)
  -pr, --print-requests        Print basic request info (default: false, env: PRINTREQUESTS)
  -au, --authuser <username>   Username for basic auth when connecting to the tunnel (env: AUTHUSER)
  -ap, --authpass <password>   Password for basic auth (env: AUTHPASS)
  -lh, --local-https           Should we use SSL/HTTPS to connect to the local host (default: false, env: LOCALHTTPS)
  -pp, --local-cert <path>     Path to certificate PEM file for local HTTPS server (env: LOCALCERT)
  -pk, --local-key <path>      Path to certificate key file for local HTTPS server (env: LOCALKEY)
  -pc, --local-ca <path>       Path to certificate authority file for self-signed certificates (env: LOCALCA)
  -aic, --allow-invalid-cert   Disable certificate checks for your local HTTPS server (ignore loca-cert/-key/-ca options) (default: false, env: ALLOWINVALIDCERT)
  -V, --version                output the version number
  --help                       display help for command

You may also specify arguments via env variables. - show in the help as (env: XXX) The evn variables can be set on commandline or by using .env file

License

MIT

Packages

No packages published

Languages

  • JavaScript 100.0%