Help With Proxy Username & Pass with GeckoFX?

前端 未结 2 1841
夕颜
夕颜 2021-01-14 03:30

I am trying to set the proxy username and password. I saw this posting (http://geckofx.org/viewtopic.php?id=832) and I thought it might be a similar setting for the usernam

相关标签:
2条回答
  • 2021-01-14 04:16

    You're trying to set them among the settings. You can access all available settings by typing about:config in the firefox addressbar, and there is no user or password setting there. I assume this is because the usernames and passwords needs to be stored securely. I think that if you leave them unset when you try to connect to the proxy it'll ask you for them and then store them somewhere secure, and it will then use that username and password automatically.

    If you do need to store them manually, I'd suggest that it might be worth to look at the Password Manager, maybe GeckoFX supports some way of accessing that?

    0 讨论(0)
  • 2021-01-14 04:24

    You probably need to set proxy type to 1. To detect proxy settings automatically, try this:

    Uri website = new Uri("http://stackoverflow.com");
    System.Net.IWebProxy defaultproxy = System.Net.WebRequest.GetSystemWebProxy();
    Uri proxy = defaultproxy.GetProxy(website); //no actual connect is done
    
    if (proxy.AbsoluteUri != website.AbsoluteUri) {
        Skybound.Gecko.GeckoPreferences.User["network.proxy.http"] = proxy.Host;
        Skybound.Gecko.GeckoPreferences.User["network.proxy.http_port"] = proxy.Port;
        Skybound.Gecko.GeckoPreferences.User["network.proxy.ssl"] = proxy.Host;
        Skybound.Gecko.GeckoPreferences.User["network.proxy.ssl_port"] = proxy.Port;
        Skybound.Gecko.GeckoPreferences.User["network.proxy.type"] = 1;
        //0 – Direct connection, no proxy. (Default)
        //1 – Manual proxy configuration.
        //2 – Proxy auto-configuration (PAC).
        //4 – Auto-detect proxy settings.
        //5 – Use system proxy settings (Default in Linux).     
    }
    
    0 讨论(0)
提交回复
热议问题