I want to use a proxy with credentials with Xilium CefGlue in C#. Can anybody tell me how to do this ?
I am doing something like this:-
internal class CefProxy : CefUrlRequestClient
{
protected override void OnDownloadData(CefUrlRequest request, Stream data)
{
throw new NotImplementedException();
}
protected override void OnDownloadProgress(CefUrlRequest request, ulong current, ulong total)
{
throw new NotImplementedException();
}
protected override void OnRequestComplete(CefUrlRequest request)
{
throw new NotImplementedException();
}
protected override void OnUploadProgress(CefUrlRequest request, ulong current, ulong total)
{
throw new NotImplementedException();
}
protected override bool GetAuthCredentials(bool isProxy, string host, int port, string realm, string scheme, CefAuthCallback callback)
{
return base.GetAuthCredentials(true, host, port, realm, scheme, callback);
}
}
But how to invoke GetAuthCredentials method ?
GetAuthCredentials called by CEF, you should not call it directly (and no have way to do it). If you need this for regular browsing: you need implement CefRequestHandler (and override GetAuthCredentials). CefUrlRequestClient is only about CefUrlRequest, and it is not clear for question what exactly you do.
Also GetAuthCredentials method will be called only for proxy which requires authorization.