2022-09-23 17:34:06 +03:00
EN | [RU ](index_ru.md )
2022-09-24 21:25:57 +03:00
___
2022-09-23 17:34:06 +03:00
# How to use the service
## Easiest method
Add this to your `~/.bashrc` or `~/.zshrc` :
```bash
http () {
2022-09-23 17:50:40 +03:00
ssh -p 2222 -oHostKeyAlgorithms=+ssh-rsa -R 80:localhost:"$1" ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
}
httpa () {
2022-09-23 17:50:40 +03:00
ssh -p 2222 -oHostKeyAlgorithms=+ssh-rsa -R "$1":80:localhost:"$2" ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
}
```
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
2022-09-23 17:50:40 +03:00
$ ssh -p 2222 -R 80:localhost:80 ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
```
* Forward service on port `:8080` with custom subdomain:
```sh
2022-09-23 17:50:40 +03:00
$ ssh -p 2222 -R subdomain:80:localhost:80 ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
```
2022-09-23 17:50:40 +03:00
* For Fedora you can add `-oHostKeyAlgorithms=+ssh-rsa` before `ssh -p 2222` to prevent any problems with the key compatibility.
2022-09-23 17:34:06 +03:00
* Function for `bash` / `zsh` to use as an alias (usage: `http 80` ):
```bash
http () {
2022-09-23 17:50:40 +03:00
ssh -p 2222 -oHostKeyAlgorithms=+ssh-rsa -R 80:localhost:"$1" ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
}
```
* Same function but with custom subdomain (usage: `httpa subdomain 80` ):
```bash
httpa () {
2022-09-23 17:50:40 +03:00
ssh -p 2222 -oHostKeyAlgorithms=+ssh-rsa -R "$1":80:localhost:"$2" ssh.neur0tx.site
2022-09-23 17:34:06 +03:00
}
```