private string ReadLocalServiceFromConfig(IConfigSource config) { IConfig serverConfig = config.Configs["LoginService"]; if (serverConfig == null) { throw new Exception(String.Format("No section LoginService in config file")); } string loginService = serverConfig.GetString("LocalServiceModule", String.Empty); if (loginService == string.Empty) { throw new Exception(String.Format("No LocalServiceModule for LoginService in config file")); } m_Proxy = serverConfig.GetBoolean("HasProxy", false); m_DosProtectionOptions = new BasicDosProtectorOptions(); // Dos Protection Options m_DosProtectionOptions.AllowXForwardedFor = serverConfig.GetBoolean("DOSAllowXForwardedForHeader", false); m_DosProtectionOptions.RequestTimeSpan = TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSRequestTimeFrameMS", 10000)); m_DosProtectionOptions.MaxRequestsInTimeframe = serverConfig.GetInt("DOSMaxRequestsInTimeFrame", 5); m_DosProtectionOptions.ForgetTimeSpan = TimeSpan.FromMilliseconds(serverConfig.GetInt("DOSForgiveClientAfterMS", 120000)); m_DosProtectionOptions.ReportingName = "LOGINDOSPROTECTION"; return(loginService); }
public GenericHTTPDOSProtector(GenericHTTPMethod normalMethod, GenericHTTPMethod throttledMethod, BasicDosProtectorOptions options) { _normalMethod = normalMethod; _throttledMethod = throttledMethod; _options = options; _dosProtector = new BasicDOSProtector(_options); }
public XmlRpcBasicDOSProtector(XmlRpcMethod normalMethod, XmlRpcMethod throttledMethod, BasicDosProtectorOptions options) { _normalMethod = normalMethod; _throttledMethod = throttledMethod; _options = options; _dosProtector = new BasicDOSProtector(_options); }
protected BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, string name, string description, BasicDosProtectorOptions options) : base(httpMethod, path, name, description) { _options = options; _dosProtector = new BasicDOSProtector(_options); }
protected BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, BasicDosProtectorOptions options) : this(httpMethod, path, null, null, options) { }
protected BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, BasicDosProtectorOptions options) : this(httpMethod, path, null, null, options) {}