0 votes
by (2.0k 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 (73.5k 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 (2.0k points)
Thank you very much.
...