#proxy #mac #macos #settings #fetch

mac_proxy

用于在MacOS上获取代理设置的Rust库

1个不稳定版本

0.1.0 2023年7月21日

#66 in #mac

MIT许可协议

91KB
126

mac_proxy

这是一个用于在MacOS上获取代理设置的Rust库。

安装

cargo add mac_procy

用法

let settings = mac_procy::mac_proxy_settings()

结果

{
  "ExceptionsList": [
    "192.168.0.0/16",
    "10.0.0.0/8",
    "172.16.0.0/12",
    "127.0.0.1",
    "localhost",
    "*.local",
    "timestamp.apple.com",
    "sequoia.apple.com",
    "seed-sequoia.siri.apple.com"
  ],
  "ExcludeSimpleHostnames": 0,
  "HTTPEnable": 1,
  "HTTPPort": 7890,
  "HTTPProxy": "127.0.0.1",
  "HTTPSEnable": 1,
  "HTTPSPort": 7890,
  "HTTPSProxy": "127.0.0.1",
  "ProxyAutoConfigEnable": 0,
  "SOCKSEnable": 1,
  "SOCKSPort": 7890,
  "SOCKSProxy": "127.0.0.1",
  "__SCOPED__": {
    "en0": {
      "ExceptionsList": [
        "192.168.0.0/16",
        "10.0.0.0/8",
        "172.16.0.0/12",
        "127.0.0.1",
        "localhost",
        "*.local",
        "timestamp.apple.com",
        "sequoia.apple.com",
        "seed-sequoia.siri.apple.com"
      ],
      "ExcludeSimpleHostnames": 0,
      "HTTPEnable": 1,
      "HTTPPort": 7890,
      "HTTPProxy": "127.0.0.1",
      "HTTPSEnable": 1,
      "HTTPSPort": 7890,
      "HTTPSProxy": "127.0.0.1",
      "ProxyAutoConfigEnable": 0,
      "SOCKSEnable": 1,
      "SOCKSPort": 7890,
      "SOCKSProxy": "127.0.0.1"
    },
    "en1": {
      "ExceptionsList": [
        "192.168.0.0/16",
        "10.0.0.0/8",
        "172.16.0.0/12",
        "127.0.0.1",
        "localhost",
        "*.local",
        "timestamp.apple.com",
        "sequoia.apple.com",
        "seed-sequoia.siri.apple.com"
      ],
      "ExcludeSimpleHostnames": 0,
      "HTTPEnable": 1,
      "HTTPPort": 7890,
      "HTTPProxy": "127.0.0.1",
      "HTTPSEnable": 1,
      "HTTPSPort": 7890,
      "HTTPSProxy": "127.0.0.1",
      "ProxyAutoConfigEnable": 0,
      "SOCKSEnable": 1,
      "SOCKSPort": 7890,
      "SOCKSProxy": "127.0.0.1"
    }
  }
}

依赖

~0.4–0.8MB
~18K SLoC