tuns

Host public web services on localhost


An ngrok alternative using just SSH.

NOTICE: This is a premium pico+ service

Features #

  • A zero-install developer tool
  • Host public web services on localhost
  • Host public tcp services on localhost
  • Share your local webserver privately with another user
  • Managed sish service

Using SSH tunnels, we can forward requests to your localhost from https, wss, and tcp.

sish-example

Demo #

tuns demo

Use cases #

Think of tuns as a developer tool. It is designed for the individual developer who is looking to prototype, demo, or otherwise deploy services without the overhead of managing a production environment with TLS, HTTP reverse proxy, and provisioning cloud infrastructure.

By using tuns you get automatic and public https for local web services.

Want to prototype a web service without fully deploying it in the cloud? You can go from starting a local web service to sharing it with the world using a single SSH command.

Hosting public web services from your home has never been easier with tuns.

Docs #

We manage a completely separate doc site for all things related to sish:

Example Usage #

1# if you have a local webserver on localhost:8000:
2ssh -R dev:80:localhost:8000 tuns.sh
3# now anyone can access it at https://{user}-dev.tuns.sh

tunmgr #

A tunnel manager for docker services.

tunmgr automatically set's up tunnels for docker services. It utilizes Expose ports as well as DNSNames (and the container name/id) to setup different permutations of tunnels.

source code

 1services:
 2  tunmgr:
 3    image: ghcr.io/picosh/tunmgr:latest
 4    restart: always
 5    volumes:
 6      - /var/run/docker.sock:/var/run/docker.sock:ro
 7      - $HOME/.ssh/id_ed25519:/key:ro
 8    healthcheck:
 9      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
10      interval: 2s
11      timeout: 5s
12      retries: 5
13      start_period: 1s
14  httpbin:
15    image: kennethreitz/httpbin
16    depends_on:
17      tunmgr:
18        condition: service_healthy
19    # labels: # or provide tunnel names and ports explicitly
20    #   tunmgr.names: httpbin # Comma separated list of names. Can be an empty
21    #   tunmgr.ports: 80:80 $ Comma separated list of port maps. (remote:local)
22    command: gunicorn -b 0.0.0.0:80 httpbin:app -k gevent --access-logfile -

With that docker compose file httpbin will be exposed as a public service on tuns.

How do I keep a tunnel open? #

If you don't want to use tunmgr then we highly recommend using a tool like autossh to automatically restart a SSH tunnel if it exits.

1autossh -M 0 -R dev:80:localhost:8000 tuns.sh

Create an account using only your SSH key.

Get Started
<< PREV
Pages
NEXT >>
Prose
Built by pico.sh LLC
206 E Huron St STE 103, Ann Arbor MI 48104