skipper 内置的常用filters
skipper 的filter 功能很强大,可做好多方便的扩展
格式:
all: * -> filter1 -> filter2 -> "http://127.0.0.1:1234/";
setRequestHeader
设置请求的header
foo: * -> setRequestHeader("X-Passed-Skipper", "true") -> "https://backend.example.org";
setResponseHeader
设置response header
foo: * ->setResponseHeader("X-Passed-Skipper", "true") -> "https://backend.example.org";
类似的header 处理的filter
appendRequestHeader,appendResponseHeader,dropRequestHeader,dropResponseHeader
path filter
modPath ,setPath,设置,或者进行path的替换
重定向操作
redirectTo,redirectToLower
redir: PathRegex(/^\/foo\/bar/) -> redirectTo(302, "/foo/newBar") -> <shunt>;
静态文件处理
static
acme: Host(/./) && Method("GET") && Path("/.well-known/acme-challenge/*")
-> static("/.well-known/acme-challenge/", "/srv/www/dehydrated") -> <shunt>;
http 状态处理
status
route1: Host(/^all401\.example\.org$/) -> status(401) -> <shunt>;
内容压缩
对于指定的内容进行压缩处理,同时可以设置压缩级别
* -> compress("...", "image/tiff") -> "https://www.example.org"
* -> compress(9, "image/tiff") -> "https://www.example.org"
查询字符串处理
setQuery,dropQuery,headerToQuery,queryToHeader
setQuery("k", "v")
dropQuery("k")
headerToQuery("X-Foo-Header", "foo-query-param")
queryToHeader("foo-query-param", "X-Foo-Header")
内容处理
randomContent 随机内容,inlineContent 返回一个内容
* -> inlineContent("<h1>Hello</h1>") -> <shunt>
* -> randomContent(42) -> <shunt>;
延迟处理
latency 请求延迟
* -> latency(120) -> "https://www.example.org";
带宽处理
可以进行请求速度的控制
* -> bandwidth(30) -> "https://www.example.org";
流量拷贝
tee
* -> tee("https://audit-logging.example.org") -> "https://foo.example.org";
认证安全
basicAuth,oauth
webhook
webhook("https://custom-webhook.example.org/auth")
cookie 处理
requestCookie,responeCookie
requestCookie("test-session", "abc")
responseCookie("test-session", "abc", 31536000),
跨域处理
corsOrigin
corsOrigin()
corsOrigin("https://www.example.org")
corsOrigin("https://www.example.org", "http://localhost:9001")
限流处理的
consecutiveBreaker,rateBreaker,clientRatelimit,ratelimit,clusterClientRatelimit,clusterRatelimit
clientRatelimit(3, "1m", "auth")
ratelimit(20, "1m")
clusterClientRatelimit(10, "1h")
审计日志处理
auditLog,enableAccessLog
api 使用监控
apiUsageMonitoring,需要启动的时候启用
skipper -enable-api-usage-monitoring -metrics-flavour prometheus
参考资料
https://opensource.zalando.com/skipper/reference/filters/
skipper 内置的常用filters的更多相关文章
- Django模板系统-内置和自定义Filters
django模板中最常用的两种特殊符号是 {{ }} 用来表示变量和 {% %} 用来表示逻辑相关的操作 变量 {{ 变量名 }} ,由字母数字下划线组成而.在模板语言中有特殊含义,用来获取对象相应的 ...
- linux shell字符串内置的常用操作(获取长度、查找、替换)
在编写shell程序时,经常会涉及到字符串相关操作.有许多命令语句,如awk,sed都能够做字符串各种操作. 事实上shell内置一系列操作符号,能够达到相似效果,使用内部操作符会省略启动外部程序等时 ...
- JavaScript内置对象常用
Math 提供了数学中常用的属性和方法,使用时直接用Math.属性/方法,而不需要new一个Math对象 Date 使用Date对象来对日期和时间进行操作.使用时,必须用new创建一个实例 windo ...
- Math内置对象 常用的方法
属性: Math.Pi 方法: Math.max() 最大值 Math.min() 最小值 Math.ceil() 向上取整 Math.floor() 向下取整 Math.random() ...
- python 全栈开发,Day51(常用内置对象,函数,伪数组 arguments,关于DOM的事件操作,DOM介绍)
昨日内容回顾 1.三种引入方式 1.行内js <div onclick = 'add(3,4)'></div> //声明一个函数 function add(a,b){ } 2. ...
- 函数和常用模块【day04】:内置函数分类总结(十一)
重点掌握 字符串格式化format() 字符串格式化百分号 判断 转换 数据类型 帮助信息 map和filter()函数 局部变量全局变量 计算内置函数 常用内置函数(其他) 后续会讲 不常用
- js流程控制;常用内置对象
一.流程控制 1.if .if-else.if-else if-else var ji = 20; if(ji >= 20){ console.log('大吉大利,晚上吃鸡') } alert( ...
- 前端JavaScript(2) --常用内置对象,函数,伪数组 arguments,关于DOM的事件操作,DOM介绍
昨日内容回顾 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ...
- 生成器的send方法、递推函数、匿名函数及常用内置函数
生成器的send方法 在使用yield方法创建生成器时,不仅可以使用next方法进行取值,还可以通过send方法向生成器的内部传值 什么是send方法? send方法相当于高级的next方法,send ...
随机推荐
- VCL界面控件DevExpress VCL Controls发布v18.2.5|附下载
DevExpress VCL Controls是 Devexpress公司旗下最老牌的用户界面套包.所包含的控件有:数据录入,图表,数据分析,导航,布局,网格,日程管理,样式,打印和工作流等,让您快速 ...
- rabbitMq无法消费发送的q的问题
1.问题叙述: 该项目配置了10来个mq,应对新开发需求,我也加了一个mq配置,然后在本地代码当中调用,当中接受,与前面写法相似,项目上测试环境测试.发现发送了queue之后本地消费日志没有的bug. ...
- countdownlatch 和 CyclicBarrier 和 Semaphore
cdl用的是aqs,共享的是aqs那个volatile的state,阻塞线程列表用的也是aqs的 cb用的是reentrantlock+condition,当然rel用的也是aqs不过不同的是用的是互 ...
- 使用libcurl下载https地址的文件
使用libcurl下载https地址的文件 void downLoadFile(std::string filename, std::string newFilename) { CURL *curl_ ...
- LVS+OSPF+FULLNAT集群架构
OSPF:OSPF(Open Shortest Path First开放式最短路径优先)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(aut ...
- mysql常见查询练习题
#建学生信息表student create table student ( sno varchar(20) not null primary key, sname varchar(20) not nu ...
- wx小程序用canvas生成图片流程与注意事项
1.需要画入canvas的 图片都需要先缓存到本地 let ps = [] ps.push(that.loadImageFun(this.statusInfo.avatar_url, "he ...
- Centos7防火墙开放8080端口
查看已经开发的端口: firewall-cmd --list-ports 开启端口: firewall-cmd --zone=public --add-port=8080/tcp --permanen ...
- LazyMan的实现
题目如下: 实现一个LazyMan,可以按照以下方式调用: LazyMan(“Hank”)输出: Hi! This is Hank! LazyMan(“Hank”).sleep(10).eat(“di ...
- php防止sql注入的方法(转)
[一.在服务器端配置] 安全,PHP代码编写是一方面,PHP的配置更是非常关键. 我们php手手工安装的,php的默认配置文件在 /usr/local/apache2/conf/php.ini,我们最 ...