Beispiel #1
0
        private void GeckoSetProxy(Enums.ProxyType proxyType, string host, int port)
        {
            switch (proxyType)
            {
            case Enums.ProxyType.Socks4:
            case Enums.ProxyType.Socks5:
                GeckoPreferences.Default["network.proxy.socks"]      = host;
                GeckoPreferences.Default["network.proxy.socks_port"] = port;
                break;

            case Enums.ProxyType.Unknown:
            case Enums.ProxyType.Http:
            case Enums.ProxyType.Https:
            default:
                GeckoPreferences.Default["network.proxy.http"]      = host;
                GeckoPreferences.Default["network.proxy.http_port"] = port;
                GeckoPreferences.Default["network.proxy.ssl"]       = host;
                GeckoPreferences.Default["network.proxy.ssl_port"]  = port;
                break;
            }

            if (proxyType == Enums.ProxyType.Socks4)
            {
                GeckoPreferences.Default["network.proxy.socks_version"] = 4;
            }
            else if (proxyType == Enums.ProxyType.Socks5)
            {
                GeckoPreferences.Default["network.proxy.socks_version"] = 5;
            }
        }
Beispiel #2
0
 public ProxyItem(string host, int port, Enums.ProxyType type, string user, string password)
 {
     Enabled   = true;
     Host      = host;
     Port      = port;
     ProxyType = type;
     UserName  = user;
     Password  = password;
 }
Beispiel #3
0
 public ProxyItem(string host, int port, Enums.ProxyType type)
     : this(host, port, type, null, null)
 {
 }