当前位置: 首页 > news >正文

ps如何做网站首页灰色行业推广平台

ps如何做网站首页,灰色行业推广平台,疯狂的大叔wordpress3.1,全国企业名录大全Rate Limiting限流插件 https://docs.konghq.com/hub/kong-inc/rate-limiting/ 它可以针对consumer ,credential ,ip ,service,path,header 等多种维度来进行限流.流量控制的精准度也有多种方式可以参考,比如可以做到秒级,分钟级,小时级等限流控制. 基于IP限流 源码地址&…

Rate Limiting限流插件

https://docs.konghq.com/hub/kong-inc/rate-limiting/

它可以针对consumer ,credential ,ip ,service,path,header 等多种维度来进行限流.流量控制的精准度也有多种方式可以参考,比如可以做到秒级,分钟级,小时级等限流控制.

基于IP限流

源码地址: kong/kong/plugins/ip-restriction/handler.lua at master · Kong/kong · GitHub

local lrucache = require "resty.lrucache"
local ipmatcher = require "resty.ipmatcher"
local kong_meta = require "kong.meta"local error = error
local kong = kong
local log = kong.log
local ngx_var = ngx.varlocal IPMATCHER_COUNT = 512
local IPMATCHER_TTL   = 3600
local cache = lrucache.new(IPMATCHER_COUNT)local IpRestrictionHandler = {PRIORITY = 990,VERSION = kong_meta.version,
}local isempty
dolocal tb_isempty = require "table.isempty"isempty = function(t)return t == nil or tb_isempty(t)end
endlocal function do_exit(status, message)status = status or 403message = message orstring.format("IP address not allowed: %s", ngx_var.remote_addr)log.warn(message)return kong.response.error(status, message)
endlocal function match_bin(list, binary_remote_addr)local matcher, errmatcher = cache:get(list)if not matcher thenmatcher, err = ipmatcher.new(list)if err thenreturn error("failed to create a new ipmatcher instance: " .. err)endcache:set(list, matcher, IPMATCHER_TTL)endlocal is_matchis_match, err = matcher:match_bin(binary_remote_addr)if err thenreturn error("invalid binary ip address: " .. err)endreturn is_match
endlocal function do_restrict(conf)local binary_remote_addr = ngx_var.binary_remote_addrif not binary_remote_addr thenreturn do_exit(403,"Cannot identify the client IP address, " .."unix domain sockets are not supported.")endlocal deny = conf.denyif not isempty(deny) thenlocal blocked = match_bin(deny, binary_remote_addr)if blocked thenreturn do_exit(conf.status, conf.message)endendlocal allow = conf.allowif not isempty(allow) thenlocal allowed = match_bin(allow, binary_remote_addr)if not allowed thenreturn do_exit(conf.status, conf.message)endend
endfunction IpRestrictionHandler:access(conf)return do_restrict(conf)
endfunction IpRestrictionHandler:preread(conf)return do_restrict(conf)
endreturn IpRestrictionHandler

http://www.ds6.com.cn/news/86360.html

相关文章:

  • 怎么看 网站开发语言任务推广引流平台
  • 西安网站建设有限公司公司怎么做网站推广
  • wordpress 列表展开收缩昆明关键词优化
  • 网站博客自媒体轻松广告营销是做什么的
  • 今天特大军事新闻事件win10必做的优化
  • 做网站上传图片软文批发网
  • 北京做网站简述seo对各类网站的作用
  • 用py做网站seo网络优化是什么意思
  • 义乌营销型网站建设北京网站seo技术厂家
  • 商城网站建设案例平台推广精准客源
  • 陕西今日重大新闻seo标题优化关键词
  • 苏州工业园区一站式服务中心网站seo方案模板
  • 哪个网站可以做微信推送北京有限公司
  • 酒店网站模版app运营推广是干什么
  • ps最好用的素材网站大专网络营销专业好不好
  • wordpress网站背景设置方法一键优化
  • wordpress文章中添加表情无锡seo优化
  • 网页设计与网站建设在线测试答案网络营销推广的方法
  • 哪里有网站做爰视频杭州seo服务公司
  • 广东省人民政府网官网关键词排名优化公司
  • 建设网站前端电商培训心得体会
  • 方正隶变简体可以做网站用么制作网站需要什么软件
  • 一般做网站用什么语言品牌营销策略四种类型
  • 做外贸铝材哪个网站比较好广州网站优化公司
  • 建设银行中国建设银行北京网站优化平台
  • 个人建网站的步骤郑州seo地址
  • 做网站的得花多少钱广州网络推广服务商
  • 网站开发经常遇到的问题google搜索引擎入口下载
  • 做网站建设百度公司官网招聘
  • 做网站都可以做什么国际网络销售平台有哪些