增加对授权用户的访问频率限制功能,可限制某段时间该用户的访问总次数及并发访问数 #818
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
限速器配置参数说明:num1,num2,num3
num1: 时间段秒数,可为大于0的整数,0表示不限制
num2: 时间段内的访问总次数,可为大于0的整数,0表示不限制
num3: 并发数,可为大于0的整数,0表示不限制
1、支持将限速器参数放在url中配置,如(设置10秒内可访问10次,最大并发数2):
-L http://root:123@:8888?limiter=10,10,2
2、也可将限速器配置在secrets文件中用户名密码后面,secrets.txt示例文件如下:
period for live reloading
reload 10s
username password
root 123 10,10,6
root2 123 0,0,3