我在看视频学习 node, 需要用 request('googlemaps'), 然后就需要 terminal 也能走代理. 我使用的是 iTerm2 和 ohmyzsh 在网上搜索了解决办法
小弟比较渣 实在是不知道怎么处理了 该怎么设置呢?
|  |      1jessynt      2017-04-30 19:54:54 +08:00 via Android 难道不是 node 程序走代理? | 
|  |      2chairuosen      2017-04-30 20:12:47 +08:00 proxychains | 
|  |      3ynyounuo      2017-04-30 20:13:50 +08:00 可以根据 Proxifier 的 Connection Log 给合适的可执行文件添加代理,而不是仅仅给虚拟终端或者命令行界面添加代理。 | 
|  |      4brooky OP @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); } ) 可是这个还是不行... | 
|      6think2011      2017-04-30 20:36:38 +08:00 proxychains +1 | 
|  |      7chairuosen      2017-04-30 20:36:57 +08:00 @brooky proxychains4 node yourcode.js | 
|      8golmic      2017-04-30 20:40:19 +08:00 proxychains +2 | 
|  |      9brooky OP 好的一会我就去搜索下怎么使用 proxychains but.. 现在我用 proxifier 的时候好像不好用 , 所以再来问一下 1. 打开 proxifier 设置 socks 代理为 127.0.0.1:1080 | 
|  |      10brooky OP 好的一会我就去搜索下怎么使用 proxychains  but.. 现在我用 proxifier 的时候好像不好用 , 所以再来问一下 1. 打开 proxifier 设置 socks 代理为 127.0.0.1:1080 2. 在 rules 界面设置 需要代理的软件 action 为 proxy 试了下 chrome 结果还是不好用 是不是在本机 的 netsetting 的 proxy 下面需要再设置呢 我看到现在的设置是 Automatic Proxy Configration | 
|  |      11kkk330      2017-04-30 21:01:58 +08:00  1 export ALL_PROXY=socks5://127.0.0.1:1080 或者 proxychains | 
|  |      12brooky OP 搜索了一下 :  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 | 
|  |      13brooky OP @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 | 
|      14iAndychan      2017-04-30 21:29:24 +08:00  1 Surge 貌似 2.1+的版本都主持了。 只要配置文件开启了,在 surge 上开启 Enhanced Mode 就可以了吧 | 
|  |      16brooky OP 原来是 proxychains 不支持 ping > 因为 proxychains 只会代理 TCP 连接,而 ping 使用的是 ICMP。记住这一点即可。 | 
|  |      17brooky OP 但是为什么会这样?? @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 | 
|      184faramita      2017-04-30 22:32:52 +08:00 proxifier 的话要么全局代理,要么 node 程序代理。而不是终端走代理 | 
|  |      19sammo      2017-04-30 22:59:57 +08:00 via Android 用 privoxy 把 ss 转为 http | 
|  |      21UnisandK      2017-04-30 23:55:10 +08:00 Proxifier 先把 Default 的行为直接改成代理,然后在用的时候看看主界面 Application 那儿的程序名。。 | 
|      22freshmanc      2017-05-01 00:38:35 +08:00 via Android @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 独有的吗? | 
|  |      23SingleX      2017-05-01 06:41:43 +08:00 via iPhone 装个 polipo,然后在打开的 terminal 中 export。 export http_proxy=http://127.0.0.1:8123 export https_proxy=http://127.0.0.1:8123 | 
|      24swirling      2017-05-01 07:01:45 +08:00 楼上正解,你没 export https proxy Google maps 是 https 吧 | 
|  |      25uuair      2017-05-01 08:47:22 +08:00 用 surge 吧 | 
|  |      26mckelvin      2017-05-01 13:55:19 +08:00 我在用 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" ``` | 
|  |      27Hawstein      2017-05-01 17:00:17 +08:00 proxychains + 1024,搭配好的梯子,Github Clone 速度 几 M/s | 
|  |      28fazero      2017-05-01 17:30:12 +08:00 看[这里]( http://t.cn/RXFGKkn) | 
|  |      29inisun      2017-05-01 17:44:27 +08:00 懒得搞,直接 anyconnect 走全局的我 | 
|      30qyc666      2017-05-01 19:01:20 +08:00 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 关闭 |