Hi, hope to get some help here. No matter what I do, I just can't make the request use the proxy. I can always see the traffic on localhost with fiddler.
Here is the constructor:
Quote:public JsBrowser()
{
_engine = Engine.Create(_indentifier);
_engine.Options.CachePath = _indentifier;
_engine.Start();
_threadRunner = new ThreadRunner(_indentifier, _engine);
_webView = _threadRunner.CreateWebView();
}
And here is the method:
Quote:public Tuple<bool, string> Dummy(WebProxy proxy)
{
var output = "";
bool valid = false;
if (proxy == null)
_engine.Options.Proxy = null;
else
{
ProxyInfo eoProxy = null;
if (proxy.Credentials != null)
{
var cr = proxy.Credentials as NetworkCredential;
eoProxy = new ProxyInfo(ProxyType.HTTP, proxy.Address.Host, proxy.Address.Port, cr.UserName, cr.Password);
}
else
eoProxy = new ProxyInfo(ProxyType.HTTP, proxy.Address.Host, proxy.Address.Port);
_engine.Options.Proxy = eoProxy;
}
_webView.CustomUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";
_threadRunner.Send(() =>
{
Request request = new Request("https://www.google.com");
_webView.LoadRequestAndWait(request);
output = _webView.EvalScript("document.cookie").ToString();
});
return new Tuple<bool, string>(valid, output);
}
I even tried to re-create the engine or webview, but no help ...