Xilium CefGlue - 如何使用代理?

时间:2017-07-01 08:52:14

标签: c# chromium-embedded cefglue

我想在C#中使用带有Xilium CefGlue凭据的代理。谁能告诉我怎么做?

我正在做这样的事情: -

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);
        }
    }

但是如何调用GetAuthCredentials方法?

1 个答案:

答案 0 :(得分:0)

CEF调用的GetAuthCredentials,你不应该直接调用它(没有办法做到这一点)。如果您需要这个用于常规浏览:您需要实现CefRequestHandler(并覆盖GetAuthCredentials)。 CefUrlRequestClient只是关于CefUrlRequest,并且不清楚你究竟做了什么。

此外,只会为需要授权的代理调用GetAuthCredentials方法。