Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
0139
V2EX  ›  Linux

how can i use pac proxy in terminal ?

  •  
  •   0139 · Jan 8, 2016 · 10718 views
    This topic created in 3952 days ago, the information mentioned may be changed or developed.

    Sorry,I haven't install Chinese language in my system yet.
    After installing lantern,chrome can surf Internet now,but in terminal
    i can't ping google.com.

    Supplement 1  ·  Jan 9, 2016
    vim ~/.bashrc
    add:
    export http_proxy='http://localhost:8787'
    export ftp_proxy='http://localhost:8787'
    export https_proxy='http://localhost:8787'
    #的确, lantern 的端口是 8787 ,这里写了:/home/*/.lantern/lantern-2.0.10.yaml
    source .bashrc
    ps.
    如果在终端直接输这段话仅当前终端窗口有效,所以写文件里了。
    一开始是发现 apt-get update 时不能连接到 dl.google.com ,
    虽然这样做还不能 ping google.com ,但可以完整更新源了:
    92% [10 Packages bzip2 0 B] [12 Packages 0 B/1,361 kB 0%] [Connecting to dl.google.com (216.58.197.110)] 520 kB/s
    proxychains 还没看,等最近考完试再弄,谢谢大家~
    18 replies  •  2016-01-20 19:20:10 +08:00
    AtlantisZ
    AtlantisZ
    Jan 8, 2016 via Android
    1
    层次不一样..ping 不是应用层的吧..
    Tink
    Tink
    Jan 8, 2016
    2
    proxychains
    AtlantisZ
    AtlantisZ
    Jan 8, 2016 via Android
    3
    @AtlantisZ 不对.是应用层直接调用网络层..
    xcodebuild
    xcodebuild
    Jan 8, 2016
    4
    proxychains ,而且你得找出 pac 里真正的 http proxy
    knightdf
    knightdf
    Jan 8, 2016
    5
    直接网络连接里设置代理不就得了
    Guenlay
    Guenlay
    Jan 8, 2016
    6
    proxychains 是全过代理 如果一定要用 PAC 的自动功能 那还得找一个支持 PAC 的程序 然后 proxychains 接上级代理
    好残的解决方案
    master13
    master13
    Jan 8, 2016
    7
    Does "in terminal i can't ping google.com." mean "connection to google.com via terminal remains unavailable." ?
    raysonx
    raysonx
    Jan 8, 2016
    8
    pac is just a simple script to configure proxy logic for a browser, not a proxy protocol.
    If you are using a SOCKS proxy, note that SOCKS only supports for TCP/UDP protocol while `ping` is based on ICMP protocol. As a result, `ping` doesn't work through those kinds of proxy.
    qinxi
    qinxi
    Jan 8, 2016
    9
    我没用 pac 模式. ss 的 windows 下 `set http_proxy=http://localhost:1080/`
    nbndco
    nbndco
    Jan 8, 2016
    10
    1.你永远也不可能通过代理服务器 ping ,用什么软件都没用
    2.你需要一个能够解析 PAC 的代理服务器然后直接把 http_proxy/https_proxy 设上去,而不是一个只能甩出一个 pac 文件的服务器。
    sammo
    sammo
    Jan 8, 2016
    11
    你不需要 pac ,你只需要设置当前终端实例(就是当前终端窗口)的 http_proxy

    打开终端,键入
    export http_proxy='http://localhost:8118'
    export https_proxy='https://localhost:8118'
    ping google.com
    只对当前终端窗口有效。

    此外,如果你用的不是 蓝灯,而是 Shadowsocks 那么需要把 ss 代理转换为 http 代理(通过 Privoxy ),再用以上方法
    imn1
    imn1
    Jan 8, 2016
    12
    ~/.bashrc
    export http_proxy="http://127.0.0.1:1080"
    export https_proxy="http://127.0.0.1:1080"

    suggest 1080 --> privoxy
    sammo
    sammo
    Jan 8, 2016
    13
    把 8118 那行命令换成 8787 ,这是 Lantern 的端口。
    " 蓝灯默认会在 [本机地址] 上开启一个 HTTP 代理的端口,端口号是 8787 "

    通过我的经验, PAC 这个东西其实并不好用 ... 所以尽量避免用 PAC 吧,手动配置
    MyFaith
    MyFaith
    Jan 8, 2016
    14
    go stackoverflow plz :)
    SoloCompany
    SoloCompany
    Jan 9, 2016
    15
    思路大概就是双重代理吧,第一重供 http proxy ,解释 pac 然后提连后端的代理或直连
    cow / 3proxy 就是类似的服务软件但本身自己做智能路由而并不直接支持第三方 pac
    然后配置 proxychain 走这个本地代理

    其实如果是 mac 或 win 的话, proxifier 是更好的解决方案,但 proxifier 也是没有 pac 支持,要自己配置路由(app/域名)
    szpunk
    szpunk
    Jan 9, 2016
    16
    Privoxy, 有脚本转把 autoproxy 转为它的规则
    gccplus
    gccplus
    Jan 16, 2016
    17
    gconftool-2 -R /system/http_proxy
    gconftool-2 -s /system/http_proxy/use_http_proxy -t bool true
    gconftool-2 -s /system/http_proxy/autoconfig_url -t string http://server.com/proxy.pac
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4616 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 09:40 · PVG 17:40 · LAX 01:40 · JFK 04:40
    ♥ Do have faith in what you're doing.