Total Pageviews

Monday, 2 September 2019

利用全局代理程序seeker翻墙

在mac机器上。
用如下的方法安装rust环境:
curl https://sh.rustup.rs -sSf | sh

会显示:

Welcome to Rust!


This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

~/.cargo/bin


This path will then be added to your PATH environment variable by modifying the
profile file located at:

  ~/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-darwin
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation       


然后运行:
source $HOME/.cargo/env
这样,rust环境就装好了。

rustup update
(把rust环境更新到最新版本)

cargo version
显示:

cargo 1.39.0-nightly (22f7dd049 2019-08-27
(或者这样安装:
brew install rust

rustup update

rust环境更新到最新版本.

 cargo version )

然后,
brew install libsodium
git clone https://github.com/gfreezy/seeker
cd seeker
sudo SODIUM_BUILD_STATIC=yes cargo build --release
显示:
...
Finished release [optimized] target(s) in 9m 30s
yudeMacBook-Air:seeker brite$ ls
Cargo.lock sample_config.yml target
Cargo.toml seeker.iml
README.md src
yudeMacBook-Air:seeker brite$ cd target
yudeMacBook-Air:target brite$ ls
debug release
yudeMacBook-Air:target brite$ cd release
yudeMacBook-Air:release brite$ ls
build examples seeker
deps incremental seeker.d
(终于生成了可执行文件seeker)
yudeMacBook-Air:release brite$ cp ../../sample_config.yml ./config.yml
yudeMacBook-Air:release brite$ nano config.yml 
(把addr的值改为你的vps的ip:ss服务器的端口
method的值改为你的ss服务器账号的加密方法
password的值改为你的ss服务器账号的密码
dns_server的值改为8.8.8.8:53

rules部分,把你所访问的某个被封网站的根域名,比如dongtaiwang.com,以格式:
- 'DOMAIN-SUFFIX,dongtaiwang.com,PROXY' 添加在- 'DOMAIN-SUFFIX,abema.io,PROXY'的下一行。
以后,若碰到某个网站打不开,则如法炮制。)
yudeMacBook-Air:release brite$ sudo ./seeker --config config.yml
yudeMacBook-Air:release brite$ sudo networksetup -setdnsservers Wi-Fi 127.0.0.1

不要关闭此terminal,然后,你的整台mac机器就处于翻墙状态了。真是爽歪歪啊。

注意:如果你的mac机器正在运行某个dns proxy,请先退出它,再运行sudo ./seeker --config config.yml
因为seeker会监听/占用本地的53端口,而dns proxy通常也是监听/占用本地的53端口,所以需要先退出
dns proxy。seeker本身内置了dns proxy功能,所以不需要额外运行其他的dns proxy。

项目地址:github.com/gfreezy/seeker
github.com/gfreezy/seeker/issues/1
github.com/gfreezy/seeker/blob/master/sample_config.yml

又是国人的杰作,赞一个。
-------------

yet, another socks transparent proxy using iptables.

你猜我在写什么?

算了算,有好久没写 C 语言了。还好 C 的基础还在。

后面再试一下 Rust-C 之前的 ABI/FFI

就可以给 deno 写 PR 了 :)

这个仓库预期是打造成新的 https://github.com/gfreezy/seeker

就是不知道有没有时间和精力去做了

# 添加
iptables -t nat -A OUTPUT -p tcp -m multiport --dports 80,443 -j REDIRECT --to-port 9999
# 删除
iptables -t nat -D OUTPUT -p tcp -m multiport --dports 80,443 -j REDIRECT --to-port 9999
from https://github.com/iamwwc/ooproxy




No comments:

Post a Comment