Improve README.md format

This commit is contained in:
Peter Dave Hello 2018-07-14 21:59:02 +08:00
parent 952bef97f1
commit 256749bd6a

View file

@ -16,6 +16,7 @@ The super easy way to setup a [Tor](https://www.torproject.org) [SOCKS5](https:/
## How to use? ## How to use?
1. Setup the proxy server at the **first time** 1. Setup the proxy server at the **first time**
```sh ```sh
$ docker run -d --name tor_socks_proxy -p 127.0.0.1:9150:9150 peterdavehello/tor-socks-proxy:latest $ docker run -d --name tor_socks_proxy -p 127.0.0.1:9150:9150 peterdavehello/tor-socks-proxy:latest
``` ```
@ -25,11 +26,13 @@ The super easy way to setup a [Tor](https://www.torproject.org) [SOCKS5](https:/
- Do not touch the second `9150` as it's the port inside the docker container unless you're going to change the port in Dockerfile. - Do not touch the second `9150` as it's the port inside the docker container unless you're going to change the port in Dockerfile.
If you already setup the instance before *(not the first time)*, just start it: If you already setup the instance before *(not the first time)*, just start it:
```
```sh
$ docker start tor_socks_proxy $ docker start tor_socks_proxy
``` ```
2. Make sure it's running, it'll take a short time to bootstrap 2. Make sure it's running, it'll take a short time to bootstrap
``` ```
$ docker logs tor_socks_proxy $ docker logs tor_socks_proxy
. .
@ -44,6 +47,7 @@ The super easy way to setup a [Tor](https://www.torproject.org) [SOCKS5](https:/
3. Configure your client to use it, target on `127.0.0.1` port `9150`(Or the other port you setup in step 1) 3. Configure your client to use it, target on `127.0.0.1` port `9150`(Or the other port you setup in step 1)
Take `curl` as an example, checkout what's your IP address via Tor network: Take `curl` as an example, checkout what's your IP address via Tor network:
```sh ```sh
$ curl --socks5-hostname 127.0.0.1:9150 ipinfo.io/ip $ curl --socks5-hostname 127.0.0.1:9150 ipinfo.io/ip
$ curl --socks5-hostname 127.0.0.1:9150 icanhazip.com $ curl --socks5-hostname 127.0.0.1:9150 icanhazip.com
@ -52,18 +56,21 @@ The super easy way to setup a [Tor](https://www.torproject.org) [SOCKS5](https:/
``` ```
Take `ssh` and `nc` as an example, connect to a host via Tor: Take `ssh` and `nc` as an example, connect to a host via Tor:
```sh ```sh
$ ssh -o ProxyCommand='nc -x 127.0.0.1:9150 %h %p' target.hostname.blah $ ssh -o ProxyCommand='nc -x 127.0.0.1:9150 %h %p' target.hostname.blah
``` ```
4. After using it, you can turn it off 4. After using it, you can turn it off
```sh ```sh
$ docker stop tor_socks_proxy $ docker stop tor_socks_proxy
``` ```
## How to renew IP? ## How to renew IP?
- To renew the IP that Tor gives you, simply restart your docker container: - To renew the IP that Tor gives you, simply restart your docker container:
```sh ```sh
$ docker restart tor_socks_proxy $ docker restart tor_socks_proxy
``` ```