Retrieve PAC script using WPAD on OSX

后端 未结 2 1590
梦谈多话
梦谈多话 2021-02-06 15:49

How do I retrieve the PAC script using WPAD on OSX? is it enough to fetch the contents of \"http://wpad/wpad.dat\" in hopes that the DNS has \"wpad\" pre-configured for this co

2条回答
  •  忘了有多久
    2021-02-06 16:16

    See section 8 of the WPAD draft on compliance. Using only DNS as you suggest would make you "minimally compliant".

    To be fully compliant, you should check to see if the host has received WPAD configuration from DHCP prior to using DNS. You should be able to use the System Configuration framework to see if the host received an option 252 parameter from the DHCP server.

    EDIT: Actually, you can get the WPAD URL directly from the system configuration framework. Looks like you'd be interested in kSCPropNetProxiesProxyAutoConfigEnable, and if that's set to 1, the WPAD URL should be in kSCPropNetProxiesProxyAutoConfigURLString.

提交回复
热议问题