Ejemplo n.º 1
0
        public ClientConfig(ConfigPackage config, BaseLogger consoleLogger, FileLogger fileLogger) : base(config)
        {
            ConsoleLogger = consoleLogger;
            FileLogger    = fileLogger;

            if (config != null)
            {
                ProxyEnabled            = config.ValueBool(CfgProxyEnabled, false);
                Expect100Continue       = config.ValueBool(CfgProxyExpect100, true);
                ProxyAutoConfiguration  = config.ValueBool(CfgProxyConfigAuto, false);
                ProxyAddress            = config.Value(CfgProxyAddress, string.Empty);
                ProxyAutoAuthentication = config.ValueBool(CfgProxyAuthAuto, false);
                ProxyUserName           = config.Value(CfgProxyUsername, string.Empty);
                ProxyPassword           = config.Value(CfgProxyPassword, string.Empty);
                ProxyDomain             = config.Value(CfgProxyDomain, string.Empty);
                ProxyPort    = config.ValueInt(CfgProxyPort, 0);
                SocksEnabled = config.ValueBool(CfgSocksEnabled, false);
                SocksShared  = config.ValueBool(CfgSocksShared, false);
                SocksPort    = config.ValueInt(CfgSocksPort, 0);
            }

            Forwards = new Dictionary <int, PortForward>();
            for (var i = IPEndPoint.MinPort; i <= IPEndPoint.MaxPort; i++)
            {
                var forward = new PortForward(config, i);
                if ((forward.RemotePort > 0) && (forward.Address != String.Empty))
                {
                    Forwards.Add(i, forward);
                }
            }
        }
Ejemplo n.º 2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="config">la configuration</param>
        /// -----------------------------------------------------------------------------
        public ClientConfig (ConfigPackage config, BaseLogger consoleLogger, FileLogger fileLogger)
            : base(config)
        {
            ConsoleLogger = consoleLogger;
            FileLogger = fileLogger;

            if (config != null)
            {
                ProxyEnabled = config.ValueBool(CfgProxyEnabled, false);
				Expect100Continue = config.ValueBool(CfgProxyExpect100, true);
                ProxyAutoConfiguration = config.ValueBool(CfgProxyConfigAuto, false);
                ProxyAddress = config.Value(CfgProxyAddress, string.Empty);
                ProxyAutoAuthentication = config.ValueBool(CfgProxyAuthAuto, false);
                ProxyUserName = config.Value(CfgProxyUsername, string.Empty);
                ProxyPassword = config.Value(CfgProxyPassword, string.Empty);
                ProxyDomain = config.Value(CfgProxyDomain, string.Empty);
                ProxyPort = config.ValueInt(CfgProxyPort, 0);
                SocksEnabled = config.ValueBool(CfgSocksEnabled, false);
                SocksShared = config.ValueBool(CfgSocksShared, false);
                SocksPort = config.ValueInt(CfgSocksPort, 0);
            }

            Forwards = new Dictionary<int,PortForward>();
            for (var i = IPEndPoint.MinPort; i <= IPEndPoint.MaxPort; i++)
            {
                var forward = new PortForward(config, i);
                if ((forward.RemotePort > 0) && (forward.Address != String.Empty))
                    Forwards.Add(i, forward);
            }
        }