Comments (5)
As the final implementation of extractor
for Orange, there are two extractors designed for the above specifics called index extractor
and template extractor
.
index extractor
This is the default extractor for Orange v0.1.*. And now one small change is added to it which works well with backward compatibility. The new feature is named as default value
.
index extractor configuration format:
"extractor": {
"type": 1, // index extractor
"extractions": [
{
"type": "Query",
"name": "wd"
},
{
"type": "Header",
"name": "from",
"default": "this_is_default_value" // used as default value if `from` not exists in "Header"
}
]
}
then use these variables extracted with this grammar ${1}
or ${2}
...
template extractor
This is a more flexible extractor aiming at solving the above requirement.
template extractor configuration format:
"extractor": {
"type": 2, // template extractor
"extractions": [
{
"type": "Query",
"name": "wd",
"default": "orange"
},
{
"type": "URI",
"name": "/redirect_baidu/(.*)/go"
}
]
}
then use these variables extracted with this grammar {{body.post_arg1}}
or {{header.uid}}
or {{query.abc}}
or {{uri.v1}}
or {{ip}}
...
e.g. http://baidu.com/s?wd={{query.wd}}&uri_arg={{uri.v1}}
.
the default value
feature is also supported by template extractor
.
from orange.
So, the only restriction on template extractor
is that we could only have one URI extractor.
from orange.
there should be only one "URI" extraction in the extractions
part of an extractor.
you could extract all variables from uri
with a RegEx, and then use them with {{uri.v1}}
/{{uri.v2}}
/{{uri.v3}}
...
from orange.
您好,这边想通过proxy_pass对url进行重写,但是后面的参数是不确定的,用您的queryString没有参数,请问这样该怎么解决
from orange.
proxy_pass的uri是可以通过配置自定义的,而且默认情况下“分流”插件不会覆盖或者抹除原来的请求参数。
如果有更细粒度的url控制需求请使用“URL重定向“或”URI重写“插件。
from orange.
Related Issues (20)
- 对规则进行添加、删除时,如果将规则都删除完后,就没有添加按钮 继续添加新规则了
- 请问orange 0.9 dev版本大概什么时间,我想使用balancer插件的功能
- 分流插件 cookie 获取信息无效 HOT 10
- 全局统计没数据 HOT 7
- 分流插件中使用,Header中获取key时,key包含下划线_导致value获取失败 HOT 2
- 分流插件中规则条件有上限的限制 HOT 1
- 反复装了N遍,还是报这个错:/usr/local/bin/orange:38: module 'bin.main' not found: HOT 8
- 我想咨询下orange的集群模式。 HOT 1
- install-orange.sh 获取的luajit目录不对 HOT 1
- master进程启动失败,但worker进程启动正常
- persist插件不完整 HOT 1
- dashboard用户密码的sha256盐值是硬编码写死的
- 中文显示的问题? HOT 1
- 规则选项里面有一个日志按钮以及清除query指的是什么
- 这个项目是已经不维护了么 HOT 7
- Provide Orange java REST client
- 有没有加密解密的插件
- 本项目已经停止维护了吗
- 大佬,还能开发一套矿池吗? HOT 1
- 怎样安装在 Rocky Linux上
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orange.