Go to file
xuu cf85dfa039
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
fix: link to active connection
2023-05-29 12:45:56 -06:00
.ansible build: add build process 2023-05-29 12:36:14 -06:00
assets feat: add home page 2023-03-27 15:31:51 -06:00
layouts feat: add home page 2023-03-27 15:31:51 -06:00
pages fix: link to active connection 2023-05-29 12:45:56 -06:00
.drone.yml fix: link to active connection 2023-05-29 12:45:56 -06:00
.gitignore feat: add reverse-proxy and session values 2021-08-26 11:45:00 -06:00
go.mod feat: add home page 2023-03-27 15:31:51 -06:00
go.sum feat: add home page 2023-03-27 15:31:51 -06:00
main.go feat: add home page 2023-03-27 15:31:51 -06:00
Makefile feat: add reverse-proxy and session values 2021-08-26 11:45:00 -06:00
mux.go refactor: move things into related files 2021-08-27 12:14:10 -06:00
README.md feat: add home page 2023-03-27 15:31:51 -06:00
server.go fix: check localhost for bind 2023-05-29 12:31:17 -06:00

sshfwd

This is a reverse proxy service that uses SSH as the transport. It works similar to ngrok or localtunnel.me.

You run the service on a internet addressible host and ssh to it. Using ssh remote forwards (ie. ssh -R) the port on the remote host will be forwared to the configured port on your local machine.

on Remote host:

$ make genkeys  # generate the services host keys.
$ SSH_HOSTKEYS=hostkeys SSH_LISTEN=:2222 SSH_DOMAIN=example.com sshfwd   # run service on port 2222

For best results place this behind a TLS termination that has a wildcard certificate and CNAME for *.yourdomain.com

on your local machine have a ssh private and public key available:

$ export LOCAL_PORT=3000; export PRIV_KEY=~/.ssh/id_ed25519; sh -c "$(shell http --form POST :2222 pub=@$(PRIV_KEY).pub)"

This will setup a reverse proxy on the example host that you can then use to access the local port. It will print a name unique to your ssh key.

$ http GET romeo-nine-lake.example.com:2222

All accesses to the proxy will have the HTTP request printed out to the ssh connection.

GET /connect HTTP/1.1
Host: romeo-nine-lake.example.com
Accept: */*
User-Agent: curl/7.64.1
X-Forwarded-Host: romeo-nine-lake.example.com
X-Origin-Host: [::1]:7000