-1

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 ?

Puneet Pant
  • 918
  • 12
  • 37

1 Answers1

0

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.

Dmitry Azaraev
  • 1,093
  • 6
  • 9
  • I just want to use a proxy with authentication. Can you tell me how to do this in CefGlue ? – Puneet Pant Jul 03 '17 at 06:00
  • @PuneetPant Read CEF docs: https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage#markdown-header-proxy-resolution – Dmitry Azaraev Jul 03 '17 at 06:03
  • I have read docs but docs implementation is mainly for CefSharp not CefGlue. I want proxy implementation with CefGlue. – Puneet Pant Jul 03 '17 at 06:05
  • @PuneetPant Mentioned doc has nothing about CefSharp, only about original CEF. And there is almost identical use in many senses in CefGlue and CefSharp. – Dmitry Azaraev Jul 03 '17 at 06:08
  • I am unable to understand anything from the docs. Can you show me some sample code please. I want to know how GetAuthCredentials method will be invoked automatically. Now I am using CefRequestHandler and overriding GetAuthCredentials. – Puneet Pant Jul 03 '17 at 10:24
  • @PuneetPant I miss your comment, so delay, sorry. But you doesnt say *anything* new for me witg last coment. I'm tried to help, but it is really hard to reply something valuable when you say that doesnt understand anything from doc. Good question already contains half of answer. Sorry. – Dmitry Azaraev Jul 06 '17 at 20:17