Total Pageviews

Thursday, 18 February 2016

Proximac is an command-line alternative to Proxifier.

With Proximac, it can force App to use SOCKS5 proxy. In the other words, it can forward any App's traffic to a certain SOCKS5 proxy. Moreover, Proximac now can forward all network traffic in your system to a proxy which means you may not need a VPN to do this job. I hope more developers can join this project.

Features:
  1. Support global traffic forwarding (VPN mode).
  2. Support SOCKS5 authentication using username/password.
Note: Proximac only works on Mac OSX.
Usage
  1. If you plan to use Proximac on OSX 10.10+, please run sudo nvram boot-args="debug=0x146 kext-dev-mode=1". For 10.11/10.12, do Restart -> Press COMMAND + R ->进入 Recovery Mode -> Terminal -> csrutil enable --without kext --without debug.
  2. Install libuv first. Run brew install libuv or whatever works
  3. Run curl -fsSL https://raw.githubusercontent.com/proximac-org/proximac-install/master/install.py |python
  4. Set up your config file which indicates Proximac's work mode (VPN or per-App) and proxy configuration
  5. Run proximac start -c [path of your config file] to start Proximac
  6. Run proximac stop to stop Proximac
注:如果你运行proximac遇到如下提示:
yudeMacBook-Air:~ brite$ proximac
env: python2: No such file or directory
yudeMacBook-Air:~ brite$

那么运行sudo ln -s /usr/bin/python /usr/bin/python2即可解决问题。

How to build from source
NOTE: Proximac is based on libuv. So, before compile this project, make sure libuv was successfully installed:
$ git clone https://github.com/libuv/libuv
$ cd libuv
$ sh autogen.sh
$ ./configure
$ make && make install
Then, open Xcode project file and build it.

An example of the config file
We use almost the same config file as shadowsocks does but add new arguments. (Not in VPN mode)
{
    "process_name":
    ["Unibox", "Google Chrome", "Thunder"], 
    "local_port":1080,
    "local_address":"127.0.0.1",
    "proximac_port":8558,
    "username":"foo",
    "password":"bar"
}
Note:
process_name are names of processes that you want to force to use SOCKS5 proxy, which can be found inContents/MacOS folder inside those Apps (right click on Apps to get inside).
local_address and local_port is the ip address and the listen port of your SOCKS5 proxy, respectively.
Leave proximac_port alone because this is now hardcoded in kext source. username and password are for SOCKS5 proxy required authentication if needed. If your SOCKS5 proxy does not require authentification, just remove these two lines.
There is another example (VPN mode)
{
    "local_port":10085,
    "local_address":"127.0.0.1",
    "proximac_port":8558,
    "VPN_mode":1,
    "proxyapp_name":"ShadowsocksX"
}
Set VPN_mode to 1 to enable VPN mode. Set proxyapp_name to your socks proxy's process name in case network traffic are trapped in a loop or we can call it a white-list but now Proximac only supports one proxy.

References

This software is partly based on projects below.
  1. Shadowsocks-libev.
  2. Shadowsocks-libuv.
  3. libuv.
  4. js0n.
  5. tcplognke (Apple).
  6. drcom4mac (As my kext dev guide book)
from https://github.com/csujedihy/proximac
-----
我的补充说明

cd ~/tlsSocks5-by-nvksie;./client -config client_config.json


proximac start -c $HOME/proximac-config.json


sudo networksetup -setdnsservers "Wi-Fi" 127.0.0.1


cd ~/goproxy-by-snail007 && sudo ./proxy dns -S socks -T tcp -P 127.0.0.1:10085 -p :53


这里socks proxy程序tlsSocks5-by-nvksie的搭建详见https://briteming.blogspot.com/2021/06/tlssocks5-by-nvksie.html 


dns proxy程序 dns-proxy-by-snail007-goproxy的搭建详见https://briteming.blogspot.com/2019/08/socks-proxydnsdns-proxy-by-snail007.html