我在看视频学习 node, 需要用 request('googlemaps'), 然后就需要 terminal 也能走代理. 我使用的是 iTerm2 和 ohmyzsh 在网上搜索了解决办法
- export http_proxy=http://127.0.0.1:1080 写入在.zshrc 文件中 //然而并不好用
- 用 proxifier //尝试设置了 iterm2 和 terminal 俩项走代理, 可是还是不好用
小弟比较渣 实在是不知道怎么处理了 该怎么设置呢?
我在看视频学习 node, 需要用 request('googlemaps'), 然后就需要 terminal 也能走代理. 我使用的是 iTerm2 和 ohmyzsh 在网上搜索了解决办法
小弟比较渣 实在是不知道怎么处理了 该怎么设置呢?
|
jessyntApr 30, 2017 via Android
1
难道不是 node 程序走代理?
|
|
chairuosenApr 30, 2017
2
proxychains
|
|
ynyounuoApr 30, 2017
3
可以根据 Proxifier 的 Connection Log 给合适的可执行文件添加代理,而不是仅仅给虚拟终端或者命令行界面添加代理。
|
|
4
@chairuosen 我看到了这个 这个是发送在前面加上前缀啊 我需要在 code 里
刚才又搜到了个方法 const url = 'https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=AIzaSyACYazWktiqvBPo5pz8BJdnIMzDwYOnfmE'; request({ url:url, proxy:'http://127.0.0.1:8080', json: true }, function (error, response, body) { console.log(error); console.log(body); console.log(response); } ) 可是这个还是不行... |
|
think2011Apr 30, 2017
6
proxychains +1
|
|
chairuosenApr 30, 2017
7
@brooky proxychains4 node yourcode.js
|
|
golmicApr 30, 2017
8
proxychains +2
|
|
9
好的一会我就去搜索下怎么使用 proxychains
but.. 现在我用 proxifier 的时候好像不好用 , 所以再来问一下 1. 打开 proxifier 设置 socks 代理为 127.0.0.1:1080 |
|
10
好的一会我就去搜索下怎么使用 proxychains
but.. 现在我用 proxifier 的时候好像不好用 , 所以再来问一下 1. 打开 proxifier 设置 socks 代理为 127.0.0.1:1080 2. 在 rules 界面设置 需要代理的软件 action 为 proxy 试了下 chrome 结果还是不好用 是不是在本机 的 netsetting 的 proxy 下面需要再设置呢 我看到现在的设置是 Automatic Proxy Configration |
|
11
export ALL_PROXY=socks5://127.0.0.1:1080 或者 proxychains
|
|
12
搜索了一下 :
1. brew install proxychains-ng 2. vim /etc/proxychains.conf 推荐配置(copy&paste&save) strict_chain 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 quiet_mode [ProxyList] socks5 127.0.0.1 1080 |
|
13
@golmic
proxychains4 ping google.com [proxychains] config file found: /usr/local/etc/proxychains.conf [proxychains] preloading /usr/local/Cellar/proxychains-ng/4.12_1/lib/libproxychains4.dylib PING google.com (216.58.200.238): 56 data bytes Request timeout for icmp_seq 0 Request timeout for icmp_seq 1 Request timeout for icmp_seq 2 Request timeout for icmp_seq 3 Request timeout for icmp_seq 4 Request timeout for icmp_seq 5 Request timeout for icmp_seq 6 Request timeout for icmp_seq 7 |
|
14
Surge 貌似 2.1+的版本都主持了。
只要配置文件开启了,在 surge 上开启 Enhanced Mode 就可以了吧 |
|
16
原来是 proxychains 不支持 ping
> 因为 proxychains 只会代理 TCP 连接,而 ping 使用的是 ICMP。记住这一点即可。 |
|
17
但是为什么会这样??
@golmic @chairuosen @think2011 proxychains4 curl www.google.com [proxychains] config file found: /usr/local/etc/proxychains.conf [proxychains] preloading /usr/local/Cellar/proxychains-ng/4.12_1/lib/libproxychains4.dylib curl: (7) Failed to connect to www.google.com port 80: Operation timed out |
|
4faramitaApr 30, 2017
18
proxifier 的话要么全局代理,要么 node 程序代理。而不是终端走代理
|
|
sammoApr 30, 2017 via Android
19
用 privoxy 把 ss 转为 http
|
|
UnisandKApr 30, 2017
21
Proxifier 先把 Default 的行为直接改成代理,然后在用的时候看看主界面 Application 那儿的程序名。。
|
|
freshmancMay 1, 2017 via Android
22
@kkk330 搜了一下,看到这么一段话
“ We already export http,ftp,https proxy environment variables. Some environments, GNOME for instance, place the socks proxy in ALL_PROXY and all_proxy. Export it as well.” 这个 allproxy 是 gnome 独有的吗? |
|
SingleXMay 1, 2017 via iPhone
23
装个 polipo,然后在打开的 terminal 中 export。
export http_proxy=http://127.0.0.1:8123 export https_proxy=http://127.0.0.1:8123 |
|
swirlingMay 1, 2017
24
楼上正解,你没 export https proxy Google maps 是 https 吧
|
|
uuairMay 1, 2017
25
用 surge 吧
|
|
mckelvinMay 1, 2017
26
我在用 Surge 和 https://github.com/janvogt/export-proxies . ~/.zshrc 里写 `eval `export-proxies``, 这样会自动配置如下变量:
``` export http_proxy="http://127.0.0.1:6152" export HTTP_PROXY="http://127.0.0.1:6152" export Http_Proxy="http://127.0.0.1:6152" export https_proxy="http://127.0.0.1:6152" export HTTPS_PROXY="http://127.0.0.1:6152" export Https_Proxy="http://127.0.0.1:6152" export all_proxy="socks5://127.0.0.1:6153" export ALL_PROXY="socks5://127.0.0.1:6153" export All_Proxy="socks5://127.0.0.1:6153" export no_proxy="192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,100.64.0.0/10,localhost,.local,e.crashlytics.com,.jd.com,.qq.com" export NO_PROXY="192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,100.64.0.0/10,localhost,.local,e.crashlytics.com,.jd.com,.qq.com" export No_Proxy="192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,100.64.0.0/10,localhost,.local,e.crashlytics.com,.jd.com,.qq.com" ``` |
|
HawsteinMay 1, 2017
27
proxychains + 1024,搭配好的梯子,Github Clone 速度 几 M/s
|
|
fazeroMay 1, 2017
28
看[这里]( http://t.cn/RXFGKkn)
|
|
inisunMay 1, 2017
29
懒得搞,直接 anyconnect 走全局的我
|
|
qyc666May 1, 2017
30
zshrc 文件里写入
``` alias ssproxy='export http_proxy=http://127.0.0.1:1080 https_proxy=http://127.0.0.1:1080' alias noproxy='unset http_proxy https_proxy' ``` 然后敲 ssproxy 开启代理 不需要的时候输 noproxy 关闭 |