简体   繁体   English

在Windows API中,是否有通用方法可以为您提供URL的适当HTTP代理?

[英]In the windows API, is there a generic method which will give you the appropriate HTTP proxy for a URL?

I'm writing an application intended for distribution around the world. 我正在编写一个打算在世界范围内分发的应用程序。 I recently discovered a method of WinHTTP: 我最近发现了WinHTTP的方法:

http://msdn.microsoft.com/en-us/library/aa384097(VS.85).aspx http://msdn.microsoft.com/zh-CN/library/aa384097(VS.85).aspx

This can decode any Netscape-style PAC file (in Javascript) and tell me the correct proxy to use for any URL I might want to use. 这可以解码任何Netscape样式的PAC文件(用Java语言编写),并告诉我用于我可能要使用的任何URL的正确代理。

That's all great, but I've noticed that some of our company sites use a proxy configuration with a "ins" file ( http://support.microsoft.com/kb/171783 ) - and the WinHTTP service seems not to understand this style of configuration. 很好,但是我注意到我们公司的某些站点使用带有“ ins”文件( http://support.microsoft.com/kb/171783 )的代理配置-WinHTTP服务似乎不了解这一点。配置样式。

So is there an alternative method I can use? 那么我可以使用另一种方法吗? Surely there must be a function somewhere which understands all of Microsoft's many and varied configuration standards? 当然,某处肯定有一个功能可以理解Microsoft的所有多种配置标准?

Thanks! 谢谢!

INS格式适用于IE,请尝试WinHttpGetIEProxyConfigForCurrentUser()获得该配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM