|
1 | | -# R-SSH |
| 1 | +# R-SSH |
| 2 | + |
| 3 | +## What can the program do? |
| 4 | +This program allows you to quickly and safely forward local port without configuring the infrastructure. |
| 5 | + |
| 6 | +Features: |
| 7 | +1. Unique static subdomain based on public key fingerprint (md5). |
| 8 | +2. Standard ssh clients are supported. |
| 9 | +3. Supported http and https forwarding. |
| 10 | +4. Automatic header correction for Host, Origin. |
| 11 | +5. Supports X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Proto. |
| 12 | + |
| 13 | +## What does it take to work? |
| 14 | + |
| 15 | +1. SSH client. |
| 16 | +2. Public key (for authorization). |
| 17 | +3. Running **r-ssh** server (you can use public server - **r-ssh.me**). |
| 18 | + |
| 19 | +##How to use? |
| 20 | + |
| 21 | +### Syntax |
| 22 | + |
| 23 | + |
| 24 | +```sh |
| 25 | +ssh -R [domain[+flags]:]<port>:target_domain:target_port r-ssh.me |
| 26 | +``` |
| 27 | + |
| 28 | +**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]_. |
| 29 | + |
| 30 | +**flags** - Flags change the logic of port forwarding. _[optional]_ |
| 31 | + |
| 32 | +Available flags: |
| 33 | +1. **s** - redirect https |
| 34 | +2. **o** - automatically fix `Origin` header (see **domain**) |
| 35 | + |
| 36 | +**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. |
| 37 | + |
| 38 | +**target_domain** - Server to which requests will be redirected |
| 39 | +**target_port** - The port to which requests will be redirected |
| 40 | + |
| 41 | + |
| 42 | +#### Examples |
| 43 | + |
| 44 | +Forward local http://localhost:8080/ to web |
| 45 | + |
| 46 | +```sh |
| 47 | +ssh -R 80:localhost:8080 r-ssh.me |
| 48 | + |
| 49 | +# forward "localhost:80" to "https://<fingeprint>.r-ssh.me/" |
| 50 | +``` |
| 51 | + |
| 52 | +Forward https://example.com:443/ to web with automatic `Host` correction |
| 53 | + |
| 54 | +```sh |
| 55 | +ssh -R example.com+s:80:example.com:443 r-ssh.me |
| 56 | + |
| 57 | +# forward "example.com+s:80" to "https://example_com-<fingeprint>.r-ssh.me/" |
| 58 | +``` |
| 59 | + |
| 60 | + |
| 61 | +#### End-to-end example |
| 62 | +[](https://asciinema.org/a/Ykmxb0lOEX0m9YNIXWT3j1SDe) |
| 63 | + |
| 64 | + |
| 65 | +# Self-hosted |
| 66 | +// TODO |
0 commit comments