Giter Site home page Giter Site logo

tunnel's Introduction

tunnel

tunnel is a reverse proxy for exposing local web servers to the outside world via SSH. It is a minimal self-hosted tool in the tradition of web services like ngrok, localtunnel, and Serveo. Like Serveo, it only requires an SSH implementation on the client; like localtunnel, it is free software.

Testing it out

A toy installation of tunnel running on localhost can be started and tested like this:

# get it
go get github.com/alexshpilkin/tunnel
# generate a host key
ssh-keygen -f ssh_host_key -t rsa -N ''
# launch the server
tunnel --bind-ssh 2222 --bind-http 8080 --authorized-keys ~/.ssh/authorized_keys
# forward test.localhost to localhost:8000
ssh -fN -R test.localhost:0:localhost:8000 -p 2222 localhost
# launch an HTTP server on localhost:8000
python -m http.server
# see the result!
curl -H 'Host:test.localhost' http://test.localhost:8080/

This may seem a bit underwhelming, but running tunnel on localhost is kind of pointless. Normally, you’d want to set it up behind a TLS terminator with a wildcard certificate and a reverse proxy so that it can give out *.yourdomain instead of *.localhost, and expose it on port 80 or 443 so that fiddling with the Host header is not necessary. The key point is that once a tunnel instance has been set up at SERVER, you can use

ssh -N -R DOMAIN:0:HOST:PORT SERVER

to expose HOST:PORT under DOMAIN.

tunnel's People

Contributors

alexshpilkin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.