How can I remove a exist proxy after HttpCreator Registration?

0 votes
asked Nov 21 by lanopk (820 points)

How can I remove a exist proxy after HttpCreator Registration when using a plugin-based HttpCreator?

HttpCreator = new Rebex.Net.HttpRequestCreator ();
HttpCreator.Register ();

...

HttpCreator.Proxy = new Rebex.Net.Proxy (Rebex.Net.ProxyType.Socks5, proxy.ProxyAddress, proxy.ProxyPort)
{
UserName = proxy.ProxyUserName,
Password = proxy.ProxyPassword
};

...

HttpCreator.Proxy = new Rebex.Net.Proxy (Rebex.Net.ProxyType.HttpConnect, proxy.ProxyAddress, proxy.ProxyPort)
{
UserName = proxy.ProxyUserName,
Password = proxy.ProxyPassword
};

...

HttpCreator.Proxy = null; --> exception

Thank you.

1 Answer

+1 vote
answered Nov 21 by Lukas Matyska (47,950 points)
selected Nov 30 by lanopk
 
Best answer

Just assign empty proxy (which is default) like this:

HttpCreator.Proxy = new Rebex.Net.Proxy();

The empty proxy has ProxyType = ProxyType.None, which means no proxy.

commented Nov 21 by lanopk (820 points)
Thank you very much.
...