This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
proxy.neur0tx.site/docs/index.md

48 lines
1.5 KiB
Markdown

EN | [RU](index_ru.md)
# How to use the service
## Easiest method
Add this to your `~/.bashrc` or `~/.zshrc`:
```bash
http () {
ssh -p 2222 -oHostKeyAlgorithms=+ssh -p 2222-rsa -R 80:localhost:"$1" ssh -p ssh.neur0tx.site
}
httpa () {
ssh -p 2222 -oHostKeyAlgorithms=+ssh -p 2222-rsa -R "$1":80:localhost:"$2" ssh -p ssh.neur0tx.site
}
```
and then run `source ~/.bashrc` or `source ~/.zshrc`.
Now you can forward your services like this:
* `http 80` to forward a service on port `:80` with random subdomain. Service will be available at `<something>.proxy.neur0tx.site`.
* `httpa domain 80` to forward a service on port `:80` with subdomain `domain`. Service will be available at `domain.proxy.neur0tx.site` (if this domain is not taken yet).
## All methods
* Forward service on port `:80` with random subdomain:
```sh
$ ssh -p 2222 -R 80:localhost:80 ssh -p ssh.neur0tx.site
```
* Forward service on port `:8080` with custom subdomain:
```sh
$ ssh -p 2222 -R subdomain:80:localhost:80 ssh -p ssh.neur0tx.site
```
* For Fedora you can add `-oHostKeyAlgorithms=+ssh -p 2222-rsa` before `ssh -p 2222` to prevent any problems with the key compatibility.
* Function for `bash` / `zsh` to use as an alias (usage: `http 80`):
```bash
http () {
ssh -p 2222 -oHostKeyAlgorithms=+ssh -p 2222-rsa -R 80:localhost:"$1" ssh -p ssh.neur0tx.site
}
```
* Same function but with custom subdomain (usage: `httpa subdomain 80`):
```bash
httpa () {
ssh -p 2222 -oHostKeyAlgorithms=+ssh -p 2222-rsa -R "$1":80:localhost:"$2" ssh -p ssh.neur0tx.site
}
```