// HTTP CC防护配置 Vue.component("http-cc-config-box", { props: ["v-cc-config", "v-is-location", "v-is-group"], data: function () { let config = this.vCcConfig if (config == null) { config = { isPrior: false, isOn: false, enableFingerprint: true, enableGET302: true, onlyURLPatterns: [], exceptURLPatterns: [], useDefaultThresholds: true, ignoreCommonFiles: true } } if (config.thresholds == null || config.thresholds.length == 0) { config.thresholds = [ { maxRequests: 0 }, { maxRequests: 0 }, { maxRequests: 0 } ] } if (typeof config.enableFingerprint != "boolean") { config.enableFingerprint = true } if (typeof config.enableGET302 != "boolean") { config.enableGET302 = true } if (config.onlyURLPatterns == null) { config.onlyURLPatterns = [] } if (config.exceptURLPatterns == null) { config.exceptURLPatterns = [] } return { config: config, moreOptionsVisible: false, minQPSPerIP: config.minQPSPerIP, useCustomThresholds: !config.useDefaultThresholds, thresholdMaxRequests0: this.maxRequestsStringAtThresholdIndex(config, 0), thresholdMaxRequests1: this.maxRequestsStringAtThresholdIndex(config, 1), thresholdMaxRequests2: this.maxRequestsStringAtThresholdIndex(config, 2) } }, watch: { minQPSPerIP: function (v) { let qps = parseInt(v.toString()) if (isNaN(qps) || qps < 0) { qps = 0 } this.config.minQPSPerIP = qps }, thresholdMaxRequests0: function (v) { this.setThresholdMaxRequests(0, v) }, thresholdMaxRequests1: function (v) { this.setThresholdMaxRequests(1, v) }, thresholdMaxRequests2: function (v) { this.setThresholdMaxRequests(2, v) }, useCustomThresholds: function (b) { this.config.useDefaultThresholds = !b } }, methods: { maxRequestsStringAtThresholdIndex: function (config, index) { if (config.thresholds == null) { return "" } if (index < config.thresholds.length) { let s = config.thresholds[index].maxRequests.toString() if (s == "0") { s = "" } return s } return "" }, setThresholdMaxRequests: function (index, v) { let maxRequests = parseInt(v) if (isNaN(maxRequests) || maxRequests < 0) { maxRequests = 0 } if (index < this.config.thresholds.length) { this.config.thresholds[index].maxRequests = maxRequests } }, showMoreOptions: function () { this.moreOptionsVisible = !this.moreOptionsVisible } }, template: `
启用CC无感防护

启用后,自动检测并拦截CC攻击。

例外URL

如果填写了例外URL,表示这些URL跳过CC防护不做处理。

限制URL

如果填写了限制URL,表示只对这些URL进行CC防护处理;如果不填则表示支持所有的URL。

忽略常用文件

忽略js、css、jpg等常在网页里被引用的文件名,即对这些文件的访问不加入计数,可以减少误判几率。

检查请求来源指纹

在接收到HTTPS请求时尝试检查请求来源的指纹,用来检测代理服务和爬虫攻击;如果你在网站前面放置了别的反向代理服务,请取消此选项。

启用GET302校验

选中后,表示自动通过GET302方法来校验客户端。

单IP最低QPS
请求数/秒

当某个IP在1分钟内平均QPS达到此值时,才会开始检测;如果设置为0,表示任何访问都会检测。(注意这里设置的是检测开启阈值,不是拦截阈值,拦截阈值在当前表单下方可以设置)

使用自定义拦截阈值
自定义拦截阈值设置
单IP每5秒最多 请求
单IP每60秒 请求
单IP每300秒 请求
` })