0 votes
by (1.7k 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
by (62.7k points)
selected by
 
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.

by (1.7k points)
Thank you very much.
...