Giter Site home page Giter Site logo

r-ssh's Introduction

R-SSH

GitHub Workflow Status Docker Cloud Build Status Docker Image Version (latest semver) Go Report Card GitHub go.mod Go version (subfolder of monorepo) Uptime Robot status GitHub

What can the program do?

This program allows you to quickly and safely forward local port without configuring the infrastructure.

Features:

  1. Unique static subdomain based on public key fingerprint (md5).
  2. Standard ssh clients are supported.
  3. Supported http and https forwarding.
  4. Automatic header correction for Host, Origin.
  5. Supports X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Proto.

What does it take to work?

  1. SSH client.
  2. Public key (for authorization).
  3. Running r-ssh server

How to use?

Syntax

ssh -R [domain[+flags]:]<port>:target_domain:target_port <host>

domain - The domain to which requests will be redirected (Host and Origin headers will be replaced by this value if the corresponding flag is enabled) [optional].

flags - Flags change the logic of port forwarding. [optional]

Available flags:

  1. s - redirect https
  2. o - automatically fix Origin header (see domain)

port - Optional for r-ssh, but mandatory for ssh client. Affects only the link generated by r-ssh. By default, port 80 is not included in the link.

target_domain - Server to which requests will be redirected target_port - The port to which requests will be redirected

Examples

Forward local http://localhost:8080/ to web

ssh -R 80:localhost:8080 <host>

# forward "localhost:80" to "https://<fingeprint>.<host>/"

Forward https://example.com:443/ to web with automatic Host correction

ssh -R example.com+s:80:example.com:443 <host>

# forward "example.com+s:80" to "https://example_com-<fingeprint>.<host>/"

End-to-end example

asciicast

Self-hosted

Docker

Without ssl:

docker run -d --restart always --name rssh -p 22:22 -p 80:80 -e RSSH_HOST=<host> -e RSSH_HOST_KEY=/mnt/id_rsa -v /root/r-ssh/:/mnt pagran/r-ssh:latest

With ssl (wildcard certificate required):

docker run -d --restart always --name rssh -p 22:22 -p 80:80 -p 443:443 -e RSSH_HOST=<host> -e RSSH_HOST_KEY=/mnt/id_rsa -e RSSH_CERT_FILE=/mnt/<host>.cer -e RSSH_KEY_FILE=/mnt/<host>.key -v /root/.acme.sh/<host>/:/mnt pagran/r-ssh:latest

r-ssh's People

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.