Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/alexshpilkin/tunnel

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/alexshpilkin/tunnel

  • v0.0.0-20200209212355-47137aac3479
  • Source
  • Go
  • Socket score

Version published
Created
Source

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.

FAQs

Package last updated on 09 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc