This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,66 @@ | ||
# R-SSH | ||
# R-SSH | ||
|
||
## 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 (you can use public server - **r-ssh.me**). | ||
|
||
##How to use? | ||
|
||
### Syntax | ||
|
||
|
||
```sh | ||
ssh -R [domain[+flags]:]<port>:target_domain:target_port r-ssh.me | ||
``` | ||
|
||
**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 | ||
|
||
```sh | ||
ssh -R 80:localhost:8080 r-ssh.me | ||
|
||
# forward "localhost:80" to "https://<fingeprint>.r-ssh.me/" | ||
``` | ||
|
||
Forward https://example.com:443/ to web with automatic `Host` correction | ||
|
||
```sh | ||
ssh -R example.com+s:80:example.com:443 r-ssh.me | ||
|
||
# forward "example.com+s:80" to "https://example_com-<fingeprint>.r-ssh.me/" | ||
``` | ||
|
||
|
||
#### End-to-end example | ||
[](https://asciinema.org/a/Ykmxb0lOEX0m9YNIXWT3j1SDe) | ||
|
||
|
||
# Self-hosted | ||
// TODO |