Skip to content

Instantly share code, notes, and snippets.

@wardenfeng
Forked from githubutilities/README.md
Created March 18, 2022 03:46

Revisions

  1. @githubutilities githubutilities revised this gist Apr 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ socks5 127.0.0.1 1080
    > Also works for Application like `Google Chrome` while `Safari` does not work, try `proxychains4 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome `.
    > But this might slow down Chrome.
    > You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac, [tsocks](http://tsocks.sourceforge.net/) for linux.
    > You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac(which does not work for me), [tsocks](http://tsocks.sourceforge.net/) for linux.
    ## Using Unix Proxy Environment Variable

  2. @githubutilities githubutilities revised this gist Apr 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ socks5 127.0.0.1 1080
    > Also works for Application like `Google Chrome` while `Safari` does not work, try `proxychains4 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome `.
    > But this might slow down Chrome.
    > You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac, [tsocks](http://tsocks.sourceforge.net/) for linux. Or use [ProxyCap](http://www.proxycap.com/).
    > You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac, [tsocks](http://tsocks.sourceforge.net/) for linux.
    ## Using Unix Proxy Environment Variable

  3. @githubutilities githubutilities revised this gist Apr 28, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22

    # Socks 5 in Terminal

    ## Using Proxychains-ng
    ## Using Proxychains-ng to socksify your command

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.
    @@ -51,6 +51,8 @@ socks5 127.0.0.1 1080
    > Also works for Application like `Google Chrome` while `Safari` does not work, try `proxychains4 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome `.
    > But this might slow down Chrome.
    > You can also use [dsocks](http://monkey.org/~dugsong/dsocks/) for mac, [tsocks](http://tsocks.sourceforge.net/) for linux. Or use [ProxyCap](http://www.proxycap.com/).
    ## Using Unix Proxy Environment Variable

    Add this script to `~/.bash_profile`.
  4. @githubutilities githubutilities revised this gist Apr 24, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -77,7 +77,7 @@ socks5 = "socks5://127.0.0.1:1080"
    * For `https://` and `http://`(e.g. `http://github.com`, `https://github.com`), run the following script.

    ```sh
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    git config --global http.proxy 'socks5://127.0.0.1:1080'
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    ```

  5. @githubutilities githubutilities revised this gist Apr 24, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -48,6 +48,8 @@ socks5 127.0.0.1 1080

    * Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`

    > Also works for Application like `Google Chrome` while `Safari` does not work, try `proxychains4 /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome `.
    > But this might slow down Chrome.
    ## Using Unix Proxy Environment Variable

  6. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -89,7 +89,7 @@ git config --global https.proxy 'socks5://127.0.0.1:1080'

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)
    * [Git proxy through SOCKS 5 by cms-sw](http://cms-sw.github.io/tutorial-proxy.html)
    * [git proxy on segmentfault](http://segmentfault.com/q/1010000000118837)


  7. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -90,6 +90,7 @@ git config --global https.proxy 'socks5://127.0.0.1:1080'
    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)
    * [git proxy on segmentfault](http://segmentfault.com/q/1010000000118837)


    # Tools
  8. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -82,15 +82,15 @@ git config --global https.proxy 'socks5://127.0.0.1:1080'
    * For `git://`(e.g. `git://github.com`), run `git config --global core.gitproxy 'socks5://127.0.0.1:1080'`
    * For ssh(e.g. `git@github.com`,`ssh://git@github.com`), add `ProxyCommand nc -x localhost:1080 %h %p` to `~/.ssh/config` file.

    > `git config --global ` is stored in `~/.gitconfig` while local config settings is in `./.git/config`.
    > To remove a configuration, e.g. run `git config --global --unset core.gitproxy`.
    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)

    > `git config --global ` is stored in `~/.gitconfig` while local config settings is in `./.git/config`.
    > To remove a configuration, e.g. run `git config --global --unset core.gitproxy`.

    # Tools

  9. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -59,7 +59,7 @@ export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Config `curl` to use SOCKS5(Also for `homebrew`)
    ## Config `curl` to use SOCKS5(Also works for `homebrew`)

    Add the following line to `~/.curlrc`. Since `homebrew` use `curl` to download the package, this will also enable `homebrew` to use SOCKS5.

  10. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 16 additions and 3 deletions.
    19 changes: 16 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22

    # Socks 5 in Terminal

    ## Solution One
    ## Using Proxychains-ng

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.
    @@ -49,7 +49,7 @@ socks5 127.0.0.1 1080
    * Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`


    ## Solution Two
    ## Using Unix Proxy Environment Variable

    Add this script to `~/.bash_profile`.

    @@ -59,7 +59,7 @@ export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Solution Three--Config `curl` to use SOCKS5(Also for `homebrew`)
    ## Config `curl` to use SOCKS5(Also for `homebrew`)

    Add the following line to `~/.curlrc`. Since `homebrew` use `curl` to download the package, this will also enable `homebrew` to use SOCKS5.

    @@ -70,6 +70,19 @@ socks5 = "socks5://127.0.0.1:1080"
    > There are no environment variables for SOCKS5 proxy servers in unix, so in order to use SOCKS5 in other utilities, check the man pages for existing tools to see if they have a configuration option for a SOCKS5 proxy and whether they have a configuration file that the configuration can be added to.

    ## Config `git` to use SOCKS5

    * For `https://` and `http://`(e.g. `http://github.com`, `https://github.com`), run the following script.

    ```sh
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    ```

    * For `git://`(e.g. `git://github.com`), run `git config --global core.gitproxy 'socks5://127.0.0.1:1080'`
    * For ssh(e.g. `git@github.com`,`ssh://git@github.com`), add `ProxyCommand nc -x localhost:1080 %h %p` to `~/.ssh/config` file.


    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
  11. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22

    # Socks 5 in Terminal

    # Solution One
    ## Solution One

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.
  12. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -59,9 +59,9 @@ export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Solution Three--Config `curl` to use SOCKS5
    ## Solution Three--Config `curl` to use SOCKS5(Also for `homebrew`)

    Add the following line to `~/.curlrc`
    Add the following line to `~/.curlrc`. Since `homebrew` use `curl` to download the package, this will also enable `homebrew` to use SOCKS5.

    ```config
    socks5 = "socks5://127.0.0.1:1080"
  13. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -59,14 +59,16 @@ export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Solution Three
    ## Solution Three--Config `curl` to use SOCKS5

    Add the following line to `~/.curlrc`

    ```config
    socks5 = "socks5://127.0.0.1:1080"
    ```

    > There are no environment variables for SOCKS5 proxy servers in unix, so in order to use SOCKS5 in other utilities, check the man pages for existing tools to see if they have a configuration option for a SOCKS5 proxy and whether they have a configuration file that the configuration can be added to.

    ## Reference

  14. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -59,6 +59,15 @@ export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Solution Three

    Add the following line to `~/.curlrc`

    ```config
    socks5 = "socks5://127.0.0.1:1080"
    ```


    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
  15. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,8 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22

    # Socks 5 in Terminal

    # Solution One

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.

    @@ -47,6 +49,16 @@ socks5 127.0.0.1 1080
    * Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`


    ## Solution Two

    Add this script to `~/.bash_profile`.

    ```sh
    export http_proxy=socks5://127.0.0.1:1080
    export https_proxy=socks5://127.0.0.1:1080
    ```


    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
  16. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -54,6 +54,7 @@ socks5 127.0.0.1 1080
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)

    > `git config --global ` is stored in `~/.gitconfig` while local config settings is in `./.git/config`.
    > To remove a configuration, e.g. run `git config --global --unset core.gitproxy`.
    # Tools

  17. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ socks5 127.0.0.1 1080
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)

    > `git config --global ` is stored in `~/.gitconfig`.
    > `git config --global ` is stored in `~/.gitconfig` while local config settings is in `./.git/config`.
    # Tools

  18. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -51,6 +51,9 @@ socks5 127.0.0.1 1080

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)
    * [Git proxy through SOCKS 5](http://cms-sw.github.io/tutorial-proxy.html)

    > `git config --global ` is stored in `~/.gitconfig`.
    # Tools

  19. @githubutilities githubutilities revised this gist Apr 23, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
    > Only config `SOCKS Host` to `127.0.0.1:1080` and select `SOCKS v5`

    # SSH Proxy
    # SOCKS 5 Through SSH Tunnel

    ```sh
    # `-N`: do not execute commands
  20. @githubutilities githubutilities revised this gist Apr 22, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,7 @@ socks5 127.0.0.1 1080
    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)
    * [OS X Terminal Ignoring SOCKS Proxy Setup](http://superuser.com/questions/377199/os-x-terminal-ignoring-socks-proxy-setup)

    # Tools

  21. @githubutilities githubutilities revised this gist Apr 22, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,10 @@ socks5 127.0.0.1 1080
    * Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`


    ## Reference

    * [how to set socks5 proxy in the terminal by askubuntu](http://askubuntu.com/questions/610333/how-to-set-socks5-proxy-in-the-terminal)

    # Tools

    ```sh
  22. @githubutilities githubutilities revised this gist Apr 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22
    * [how-do-i-set-up-a-linux-proxy-for-my-mac by askubuntu](http://askubuntu.com/questions/143303/how-do-i-set-up-a-linux-proxy-for-my-mac)


    # Running Socks 5 in Terminal
    # Socks 5 in Terminal

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.
  23. @githubutilities githubutilities revised this gist Apr 22, 2015. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -29,10 +29,24 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22
    ```


    # Reference
    ## Reference

    * [how-do-i-set-up-a-linux-proxy-for-my-mac by askubuntu](http://askubuntu.com/questions/143303/how-do-i-set-up-a-linux-proxy-for-my-mac)


    # Running Socks 5 in Terminal

    * Install `proxychains-ng` by running `brew install proxychains-ng`.
    * Config `/usr/local/Cellar/proxychains-ng/4.7/etc/proxychains.conf`, modify the following parameters.

    ```config
    [ProxyList]
    socks5 127.0.0.1 1080
    ```

    * Add `proxychains4` to the front of every command, e.g. `proxychains4 curl ipecho.net/plain`


    # Tools

    ```sh
  24. @githubutilities githubutilities revised this gist Apr 22, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,10 @@ ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22
    ```


    # Reference

    * [how-do-i-set-up-a-linux-proxy-for-my-mac by askubuntu](http://askubuntu.com/questions/143303/how-do-i-set-up-a-linux-proxy-for-my-mac)

    # Tools

    ```sh
  25. @githubutilities githubutilities created this gist Apr 22, 2015.
    36 changes: 36 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    # Shadowsocks Proxy

    ## [Server-side setup](https://github.com/shadowsocks/shadowsocks)

    ```sh
    apt-get install python-pip
    pip install shadowsocks

    sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
    ```


    ## Client-side setup

    * Install Shadowsocks Client, e.g. run `brew cask install shadowsocksx` in Mac OSX.
    * SwitchSharp

    > Only config `SOCKS Host` to `127.0.0.1:1080` and select `SOCKS v5`

    # SSH Proxy

    ```sh
    # `-N`: do not execute commands
    # `-D`: bind 1080 port and forward 1080 port to 22 port
    # `-i`: use pre-shared key `hello.pem`
    # `-p`: specify port used to connect to remote server
    ssh -ND 1080 -i ~/.ssh/hello.pem <username>@<your-remote-server-ip> -p 22
    ```


    # Tools

    ```sh
    curl --socks5-hostname 127.0.0.1:1080 http://wtfismyip.com/json
    ```