porxychains intro and usage

Intro

proxychains is a tool used for providing proxy for different apps. Currently we use it for convert http proxy to socks5 proxy.

Usage

installation

Installation is very convenient, just follow blogs and offical tutorial on https://github.com/rofl0r/proxychains-ng and https://github.com/haad/proxychains

On macos just do: brew install proxychains-ng. For apps in /usr/bin we have to turn off sip. But we can use proxychains directly for apps in other paths, see:

https://xenojoshua.com/2020/10/proxychains/ https://www.tcdw.net/post/proxychains-with-sip/

just add the proxy

convert http proxy to socks5 proxy

The basic idea is to use a socks5 on proxychains. We find a simple socks5 proxy server: https://github.com/onriv/simple-socks5-server. It's a simple version implemented in netty.

Just beware that starting it like

JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/ proxychains4  \
         /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java \
         -cp :$(fd jar lib -I|perl -pe 's/\n/:/g') \
         me.dijedodol.socks5.server.simple.App -b 0.0.0.0:6086

do not use /usr/bin/java, for the reason mentioned above

(And for building this app, use:

JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/ \
         PATH=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:$PATH \
         ./gradlew -Dhttps.proxyHost=10.36.2.52 \
         -Dhttp.proxyHost=10.36.2.52 \
         -Dhttp.proxyPort=8080 \
         -Dhttps.proxyPort=8080 \
         distZip

TODO but still, this way on chrome giving us an untrusted liscense

chain unreachable ss proxy on a http proxy

Using proxychains we can reach a ssproxy on an untrusted http porxy too.

just start ss-local on proxychains

like:

proxychains4 /usr/local/opt/shadowsocks-libev/bin/ss-local \
             -c heroku-ss-local-config.json \
             --fast-open --reuse-port