facebook c# sdk proxy setting

183 Views Asked by At

I have been trying to add proxy setting options for my facebook app.

I am using the C# SDK latest and testing with sample code from the SDK. I have set up a proxy server to test with and when I request data using http, I see the result data coming back correctly. (proxy server, port with uri provided)

But somehow when I test using facebook API, although I see the login window popping up correctly, I don't see any log change in the proxy server side.

Here is the code I am using

    public FacebookLoginDialog(FacebookClient fb, string appId, string[] extendedPermissions)
    {
        if (fb == null)
            throw new ArgumentNullException("fb");
        if (string.IsNullOrWhiteSpace(appId))
            throw new ArgumentNullException("appId");

        _fb = fb;

        _fb.HttpWebRequestFactory = uri =>
        {
            var request = new HttpWebRequestWrapper((HttpWebRequest)WebRequest.Create(uri));
            MessageBox.Show("called");
            request.Proxy = new System.Net.WebProxy("10.0.1.14", 808); // normal .net IWebProxy
            return request;
        };

        //request.Credentials = new NetworkCredential("username", "password", "domain");
        _loginUrl = GenerateLoginUrl(appId, extendedPermissions);

        InitializeComponent();
    }

Please shine me some light.

0

There are 0 best solutions below