Discussion:
Problem with Proxy list in WinHttpSetOption
(too old to reply)
Wolfgang-h
2008-07-07 07:23:01 UTC
Permalink
Hello my problem is quite small but I don't find any clue in the MSDN:

I fetch with WinHttpGetProxyForUrl a list of possible Proxies in the
WINHTTP_PROXY_INFO structure. ("proxy1;proxy2")

When I set the proxies into the Winhttp system (WinHttpSetOption) only the
first proxy is used. That means, if the first proxy is down, the second proxy
is never used.

Is there anypossible way to configure WINHTTP to try all passed proxies?

thanks
Wolfgang
Eric Loewenthal
2008-07-29 06:44:00 UTC
Permalink
Post by Wolfgang-h
I fetch with WinHttpGetProxyForUrl a list of possible Proxies in the
WINHTTP_PROXY_INFO structure. ("proxy1;proxy2")
When I set the proxies into the Winhttp system (WinHttpSetOption) only the
first proxy is used. That means, if the first proxy is down, the second proxy
is never used.
Is there anypossible way to configure WINHTTP to try all passed proxies?
thanks
Wolfgang
Eric Loewenthal
2008-07-29 06:49:01 UTC
Permalink
Hi Wolfgang,

WinHttp does not have automatic proxy failover. This means that it is up to
the application developer to iterate through the proxy list when a connection
fails. To do this you can use WinHttpSetOption with WINHTTP_OPTION_PROXY and
set the proxy list again, only this time move the proxy proxy pointer to the
start of proxy2. Repeat until success or there are no more proxies to try.

Let me know you have any more questions.

Thanks!

Eric Loewenthal
Post by Wolfgang-h
I fetch with WinHttpGetProxyForUrl a list of possible Proxies in the
WINHTTP_PROXY_INFO structure. ("proxy1;proxy2")
When I set the proxies into the Winhttp system (WinHttpSetOption) only the
first proxy is used. That means, if the first proxy is down, the second proxy
is never used.
Is there anypossible way to configure WINHTTP to try all passed proxies?
thanks
Wolfgang
Wolfgang-h
2008-07-29 08:51:01 UTC
Permalink
Thanks for the help,
I am now implementign a kind of round-robin to try and failover the
different proxies.

regards
Wolfgang
Post by Eric Loewenthal
Hi Wolfgang,
WinHttp does not have automatic proxy failover. This means that it is up to
the application developer to iterate through the proxy list when a connection
fails. To do this you can use WinHttpSetOption with WINHTTP_OPTION_PROXY and
set the proxy list again, only this time move the proxy proxy pointer to the
start of proxy2. Repeat until success or there are no more proxies to try.
Let me know you have any more questions.
Thanks!
Eric Loewenthal
Post by Wolfgang-h
I fetch with WinHttpGetProxyForUrl a list of possible Proxies in the
WINHTTP_PROXY_INFO structure. ("proxy1;proxy2")
When I set the proxies into the Winhttp system (WinHttpSetOption) only the
first proxy is used. That means, if the first proxy is down, the second proxy
is never used.
Is there anypossible way to configure WINHTTP to try all passed proxies?
thanks
Wolfgang
Loading...