V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
biuuu
V2EX  ›  问与答

有人遇到过这个 iOS 的 pac 文件解析问题吗?

  •  
  •   biuuu · Jun 27, 2018 · 2830 views
    This topic created in 2867 days ago, the information mentioned may be changed or developed.
    function FindProxyForURL(url, host) {
      return "PROXY 192.168.2.36:8801; DIRECT";
    }
    

    如果用上面的规则,第一个代理无法访问的话,

    直接所有网站都打不开了,而不会使用 DIRECT 去直连。

    我用 iOS 11.4 和 12 都有这个问题。

    而 PC 和 Android 用同样的规则就没事。

    是 iOS 不支持这种写法吗?

    3 replies    2019-06-18 14:34:28 +08:00
    fdb713
        1
    fdb713  
       Jun 27, 2018
    给你参考一下我用的
    ```javascript
    function FindProxyForURL(url, host) {
    if (isPlainHostName(host)) {
    return direct;
    }
    if (isIPv4(host)) {
    if (isInNets(DirectNetworks, host))
    return direct;
    } else {
    if (isSuffixes(DirectSuffixes, host))
    return direct;
    }
    return proxy;
    }
    ```
    https://github.com/yukixz/whitepac
    yhuaqiang
        2
    yhuaqiang  
       Jun 18, 2019 via iPhone
    你好,我也遇到这个问题了,好像就是不用直连。请问你解决了吗
    yhuaqiang
        3
    yhuaqiang  
       Jun 18, 2019 via iPhone
    这个问题很奇怪啊,只有 chrome 的一个插件能够自动识别,安卓也不行。 是不是现在支持情况还不好啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   877 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 19:00 · PVG 03:00 · LAX 12:00 · JFK 15:00
    ♥ Do have faith in what you're doing.