Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

科学上网终极方案 #38

Open
riskers opened this issue Aug 14, 2018 · 3 comments
Open

科学上网终极方案 #38

riskers opened this issue Aug 14, 2018 · 3 comments
Labels
tools 工具、小技巧

Comments

@riskers
Copy link
Owner

riskers commented Aug 14, 2018

因为 GFW 的存在让我们一直无法畅快地浏览网站、使用软件、开发程序,现在就这几个方面一一展开说明。

事先准备

SwitchyOmega - 浏览器科学上网

下载地址: https://chrome.google.com/webstore/detail/padekgcemlokbadohgkifijomclgjgif

可以在浏览器中方便地针对某些网站使用 SS 。

Proxifier - GUI 软件科学上网

下载地址: https://www.proxifier.com

它可以让你自己添加软件到 rules 中,这样你的这些软件就可以使用 SS 来科学上网了。比如 TelegramSignalTerllo 等就可以畅快地使用了。

proxychains4 - 终端科学上网

比较麻烦,还要关闭 Mac 的 SIP:

  1. 重启Mac,按住Option键进入启动盘选择模式,再按⌘ + R进入Recovery模式
  2. 实用工具(Utilities)-> 终端(Terminal
  3. csrutil disable
  4. 重启
  5. 查看是否成功 csrutil status

自己编译安装:

  1. git clone git@github.com:rofl0r/proxychains-ng.git
  2. cd proxychains-ng
  3. ./configure
  4. make && make install
  5. cd .. && rm -rf proxychains-ng

修改配置,配置文件在 /etc/proxychains.conf:

# proxychains.conf  VER 4.x

strict_chain

chain_len = 1

proxy_dns
remote_dns_subnet 224

tcp_read_time_out 15000
tcp_connect_time_out 8000

localnet 127.0.0.0/255.0.0.0

[ProxyList]

socks5 127.0.0.1 1086

然后就大功告成了,试试:


2018.11.14 updated

最近在玩 Go,安装 golang.org/x 下的安装包的时候发现 proxychains4 go get 竟然不能正确地安装,原因是 proxychains 是通过修改动态加载库来实现代理,但go是静态编译的,因此,proxychains无法代理go。

幸好 ShadowsocksX-NG 提供了 http 代理,在.zshrc 添加:

alias p-on='export http_proxy=127.0.0.1:1087;export https_proxy=$http_proxy'
alias p-off='unset http_proxy;unset https_proxy'

在终端下,p-on 可以打开 http 代理,p-off 可以关闭 http 代理

2022.7.27 updated

现在使用 clashX 就够了


向我捐助 | 关于我 | 工作机会


@Dcatfly
Copy link

Dcatfly commented Aug 14, 2018

有Proxifier就不需要proxychains4了。而且ShadowsocksX-NG自带了http的代理。

@riskers
Copy link
Owner Author

riskers commented Aug 14, 2018

@Dcatfly Proxifier 不能在终端使用吧

@Dcatfly
Copy link

Dcatfly commented Aug 14, 2018

@riskers 可以指定程序,比如你用curl,那么可以在规则中添加curl。我一般用ShadowsocksX-NG里面的http代理,拷贝粘贴到终端即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools 工具、小技巧
Projects
None yet
Development

No branches or pull requests

2 participants