You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/10/17 00:46:00 UTC

[GitHub] [dubbo-go-pixiu] AlexStocks commented on a change in pull request #277: Document

AlexStocks commented on a change in pull request #277:
URL: https://github.com/apache/dubbo-go-pixiu/pull/277#discussion_r730275368



##########
File path: docs/common/faq.md
##########
@@ -2,12 +2,4 @@
 
 In case you did not find any answer here and in [closed issues](https://github.com/apache/dubbo-go-pixiu/issues?q=is%3Aissue+is%3Aclosed), [create new issue](https://github.com/apache/dubbo-go-pixiu/issues/new/choose).

Review comment:
       If you can not get any help from this doc or [closed issues](https://github.com/apache/dubbo-go-pixiu/issues?q=is%3Aissue+is%3Aclosed), please [submit a new issue](https://github.com/apache/dubbo-go-pixiu/issues/new/choose).

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.

Review comment:
       When receives request from listener, filter will handle it one by one at its pre or post phase.
   

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.

Review comment:
       the request processing order is as follows.

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.

Review comment:
       You can find out all filters in 'pkg/filter'. Just list some filters as the following.

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.

Review comment:
       Then pixiu will fill it's value by pixiu config yaml.

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.

Review comment:
       请把 Apply 用单引号 '' 标记下。其他地方也如此。我看到会继续提出来。

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.
+
+when request comes, pixiu will call PrepareFilterChain function to allow filter add itself into request-filter-chain.

Review comment:
       PrepareFilterChain 加上单引号 ''

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.
+
+when request comes, pixiu will call PrepareFilterChain function to allow filter add itself into request-filter-chain.
+
+```go
+func (f *Filter) PrepareFilterChain(ctx *http.HttpContext) error {
+	ctx.AppendFilterFunc(f.Handle)
+	return nil
+}
 ```
+If not use AppendFilterFunc to add self into filter-chain, then filter will not handle the request this time.

Review comment:
       PrepareFilterChain 加上单引号

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.
+
+when request comes, pixiu will call PrepareFilterChain function to allow filter add itself into request-filter-chain.
+
+```go
+func (f *Filter) PrepareFilterChain(ctx *http.HttpContext) error {
+	ctx.AppendFilterFunc(f.Handle)
+	return nil
+}
 ```
+If not use AppendFilterFunc to add self into filter-chain, then filter will not handle the request this time.
 
-### Timeout filter
+Finally pixiu will call Handle function.
 
-api timeout control, independent config for each interface.
+```go
+func (f *Filter) Handle(ctx *http.HttpContext) {
+	f.handleCors(ctx)
+	ctx.Next()
+}
+
+```
 
-#### Basic response
+There are two phase during request handle, pre and post. before calling ctx.Next function, there is pre phase,otherwise there is post phase.

Review comment:
       There are two phases during handle the request, the pre and the post. Before calling `ctx.Next` function, the phase is pre. And After calling it, the phase is post.

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.
+
+when request comes, pixiu will call PrepareFilterChain function to allow filter add itself into request-filter-chain.
+
+```go
+func (f *Filter) PrepareFilterChain(ctx *http.HttpContext) error {
+	ctx.AppendFilterFunc(f.Handle)
+	return nil
+}
 ```
+If not use AppendFilterFunc to add self into filter-chain, then filter will not handle the request this time.
 
-### Timeout filter
+Finally pixiu will call Handle function.
 
-api timeout control, independent config for each interface.
+```go
+func (f *Filter) Handle(ctx *http.HttpContext) {
+	f.handleCors(ctx)
+	ctx.Next()
+}
+
+```
 
-#### Basic response
+There are two phase during request handle, pre and post. before calling ctx.Next function, there is pre phase,otherwise there is post phase.
 
-[reference](../user/response.md#timeout)
 
-### Response filter
 
-Response result or err.
+#### step two
 
-#### Common result
+register plugin into management in init function.
 
-[reference](../sample/dubbo-body.md)
+```go
+const (
+	// Kind is the kind of Fallback.
+	Kind = constant.HTTPCorsFilter
+)
+
+func init() {
+	filter.RegisterHttpFilter(&Plugin{})
+}
+```
 
-### Host filter
+#### step three
 
+Add unnamed import in pkg/pluginregistry/registry.go file to make init function invoking.

Review comment:
       Add unnamed import in `pkg/pluginregistry/registry.go` file to make 'init' function invoking.
   

##########
File path: docs/developer/filter.md
##########
@@ -1,49 +1,200 @@
 # Filter
 
-Filter is the composition of filter chain, make use more control.
 
-## Default filter
+Filter provides request handle abstraction. user can combinate many filter together into filter-chain.
 
-### Remote filter
+When receive request from listener, filter will handle it in the order at pre or post phase.
 
-call downstream service, only for call, not process the response. 
+Because pixiu want offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter.
 
-#### field
+the request handle process like below.
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+### Http Filter List
+
+You can find out all filters in pkg/filter, just list some import ones.
+
+- ratelimit the filter provides rate limit function using sentinel-go;
+- timeout the filter provides timeout function;
+- tracing the filter provides tracing function with jaeger;
+- grpcproxy the filter provides http to grpc proxy function;
+- httpproxy the filter provides http to http proxy function;
+- proxywrite the filter provides http request path or header amend function;
+- apiconfig the filter provides http to dubbo transform mapping function with remote filter;
+- remote the filter provides http to dubbo proxy function with apiconfig filter.
+
+
+### How to define custom http filter
+#### step one
+
+There are two abstraction interface: plugin and filter.
+
+```go
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+
+// HttpFilter describe http filter
+type HttpFilter interface {
+    // PrepareFilterChain add filter into chain
+    PrepareFilterChain(ctx *http.HttpContext) error
+
+    // Handle filter hook function
+    Handle(ctx *http.HttpContext)
+
+    Apply() error
+
+    // Config get config for filter
+    Config() interface{}
+}
+```
+
+You should define yourself plugin and filter, then implement its function.
+
+Otherwise, you maybe would define filter-own config like as below.
+
+```go
+// Config describe the config of Filter
+type Config struct {		
+	AllowOrigin []string `yaml:"allow_origin" json:"allow_origin" mapstructure:"allow_origin"`
+	// AllowMethods access-control-allow-methods
+	AllowMethods string `yaml:"allow_methods" json:"allow_methods" mapstructure:"allow_methods"`
+	// AllowHeaders access-control-allow-headers
+	AllowHeaders string `yaml:"allow_headers" json:"allow_headers" mapstructure:"allow_headers"`
+	// ExposeHeaders access-control-expose-headers
+	ExposeHeaders string `yaml:"expose_headers" json:"expose_headers" mapstructure:"expose_headers"`
+	// MaxAge access-control-max-age
+	MaxAge           string `yaml:"max_age" json:"max_age" mapstructure:"max_age"`
+	AllowCredentials bool   `yaml:"allow_credentials" json:"allow_credentials" mapstructure:"allow_credentials"`
+}
+```
 
-> level: mockLevel 
- 
-- 0:open Global mock is open, api need config `mock=true` in `api_config.yaml` will mock response. If some api need mock, you need use this. 
-- 1:close Not mock anyone.
-- 2:all Global mock setting, all api auto mock.
+You can initialize filter-own config instance when plugin CreateFilter, and return it at config function.
 
-result
-```json
-{
-    "message": "success"
+```go
+
+func (p *Plugin) CreateFilter() (filter.HttpFilter, error) {
+     return &Filter{cfg: &Config{}}, nil
+}
+
+func (f *Filter) Config() interface{} {
+	return f.cfg
 }
 ```
+Then pixiu will fill it's value using the value in pixiu config yaml.
 
-#### Pixiu log 
-```bash
-2020-11-17T11:31:05.718+0800    DEBUG   remote/call.go:92       [dubbo-go-pixiu] client call resp:map[age:88 iD:3213 name:tiecheng time:<nil>]
+After filling config value, pixiu will call Apply function, you should prepare filter, such as fetch remote info etc.
+
+when request comes, pixiu will call PrepareFilterChain function to allow filter add itself into request-filter-chain.
+
+```go
+func (f *Filter) PrepareFilterChain(ctx *http.HttpContext) error {
+	ctx.AppendFilterFunc(f.Handle)
+	return nil
+}
 ```
+If not use AppendFilterFunc to add self into filter-chain, then filter will not handle the request this time.
 
-### Timeout filter
+Finally pixiu will call Handle function.
 
-api timeout control, independent config for each interface.
+```go
+func (f *Filter) Handle(ctx *http.HttpContext) {
+	f.handleCors(ctx)
+	ctx.Next()
+}
+
+```
 
-#### Basic response
+There are two phase during request handle, pre and post. before calling ctx.Next function, there is pre phase,otherwise there is post phase.
 
-[reference](../user/response.md#timeout)
 
-### Response filter
 
-Response result or err.
+#### step two
 
-#### Common result
+register plugin into management in init function.
 
-[reference](../sample/dubbo-body.md)
+```go
+const (
+	// Kind is the kind of Fallback.
+	Kind = constant.HTTPCorsFilter
+)
+
+func init() {
+	filter.RegisterHttpFilter(&Plugin{})
+}
+```
 
-### Host filter
+#### step three
 
+Add unnamed import in pkg/pluginregistry/registry.go file to make init function invoking.
+
+```go
+	_ "github.com/apache/dubbo-go-pixiu/pkg/filter/cors"
+```
+
+
+#### step four
+
+Add filter config in yaml file.
+
+```go
+http_filters:
+  - name: dgp.filter.http.httpproxy
+    config:
+  - name: dgp.filter.http.cors
+    config:
+      allow_origin:
+        - api.dubbo.com
+      allow_methods: ""
+      allow_headers: ""
+      expose_headers: ""
+      max_age: ""
+      allow_credentials: false
+```
+
+
+#### example
+
+There is a simple filter located in pkg/filter/cors which provider http cors function.

Review comment:
       There is a simple filter located in 'pkg/filter/cors' which provider http 'cors' function.
   

##########
File path: docs/sample/others/jaeger.md
##########
@@ -0,0 +1,16 @@
+
+
+#### Tracing with Jaeger
+
+
+there is tracing filter, we can use it to add tracing function for pixiu

Review comment:
       There is a tracing filter, by which we can add tracing function for pixiu

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:

Review comment:
       Besides, pixiu provides another dubbo-specific config named 'api_config', by which 'dubbo-filter' can transform 
    the http request to dubbo generic call. You can also find it in those samples's pixiu directory.
   
   The document [Api Model](api.md) provides the api_config specification about  the pixiu config abstraction .

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:

Review comment:
       Besides, pixiu provides another dubbo-specific config named 'api_config', by which 'dubbo-filter' can transform the http request to dubbo generic call. You can also find it in those samples's pixiu directory.
   
   The document [Api Model](api.md) provides the api_config specification about  the pixiu config abstraction .

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.
+
+There are many build-in filter such as cors、metric、ratelimit or timeout. for example, dgp.filter.http.response in config above.
+
+#### route
+
+After filter handled, pixiu will forward the request to upstream server by route. the route provider forward rules such as path、method and header matches
+
+```
+routes:
+- match:
+    prefix: "/user"
+  route:
+    cluster: "user"
+    cluster_not_found_response_code: 505
+```
+
+#### cluster
+
+the cluster represents the same service instance cluster which specify upstream server info 
+
+```
+clusters:
+- name: "user"
+  lb_policy: "lb"
+  endpoints:
+    - id: 1
+      socket_address:
+        address: 127.0.0.1
+        port: 1314
+```
+
+
+#### Adapter
+
+the adapter communicates with service-registry such as zk, nacos to fetch service instance info and produce route and cluster config automatically.
+
+There are two adapter you can find in pkg/adapter.

Review comment:
       There are two adapters in ‘pkg/adapter’.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.
+
+There are many build-in filter such as cors、metric、ratelimit or timeout. for example, dgp.filter.http.response in config above.
+
+#### route
+
+After filter handled, pixiu will forward the request to upstream server by route. the route provider forward rules such as path、method and header matches
+
+```
+routes:
+- match:
+    prefix: "/user"
+  route:
+    cluster: "user"
+    cluster_not_found_response_code: 505
+```
+
+#### cluster
+
+the cluster represents the same service instance cluster which specify upstream server info 
+
+```
+clusters:
+- name: "user"
+  lb_policy: "lb"
+  endpoints:
+    - id: 1
+      socket_address:
+        address: 127.0.0.1
+        port: 1314
+```
+
+
+#### Adapter
+
+the adapter communicates with service-registry such as zk, nacos to fetch service instance info and produce route and cluster config automatically.

Review comment:
       The ‘adapter’ communicates with service-registry such as zk/nacos to fetch service instance info and also produces the route and cluster config.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.
+
+There are many build-in filter such as cors、metric、ratelimit or timeout. for example, dgp.filter.http.response in config above.
+
+#### route
+
+After filter handled, pixiu will forward the request to upstream server by route. the route provider forward rules such as path、method and header matches
+
+```
+routes:
+- match:
+    prefix: "/user"
+  route:
+    cluster: "user"
+    cluster_not_found_response_code: 505
+```
+
+#### cluster
+
+the cluster represents the same service instance cluster which specify upstream server info 

Review comment:
       The 'cluster' represents the same service instance cluster which specify upstream server info.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.
+
+There are many build-in filter such as cors、metric、ratelimit or timeout. for example, dgp.filter.http.response in config above.
+
+#### route
+
+After filter handled, pixiu will forward the request to upstream server by route. the route provider forward rules such as path、method and header matches

Review comment:
       After ‘filter’ handled the request, pixiu will forward the request to upstream server by 'route'. The 'route' provider forward rules such as path/method/header matches

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.

Review comment:
       There also are many protocol-specific filters such as http-to-grpc/http-to-dubbo etc, such as 'dgp.filter.http.httpproxy' in the above config.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.
+
+##### http filter 
+
+There also are many protocol-specific filters such as http-to-grpc filter、http-to-dubbo filter etc. for example, dgp.filter.http.httpproxy in config above.
+
+There are many build-in filter such as cors、metric、ratelimit or timeout. for example, dgp.filter.http.response in config above.

Review comment:
       There are many build-in filter such as cors/metric/ratelimit/timeout, such as 'dgp.filter.http.response' in the above config.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below
+```
+client -> listner -> network filter such as httpconnectionmanager -> http filter chain
+
+```
+
+##### network filter
+
+Pixiu supports http protocol only. for example dgp.filter.httpconnectionmanager in config above.

Review comment:
       Pixiu supports http protocol only, such as 'dgp.filter.httpconnectionmanager' in the above config.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.
+
+#### filter
+
+Filter provides request handle abstraction. user can combine many filter together into filter-chain.
+
+When receives request from the listener, filter will handle it in the order at pre or post phase.
+
+Because pixiu wants offer network protocol transform function, so the filter contains network filter and the filter below network filter such as http filter
+
+the request handle process like below

Review comment:
       Filter provides request handle abstraction. You can combine many filter together into filter-chain.
   
   When receives request from the listener, filter will handle it orderly at its pre or post phase.
   
   Because pixiu wants offer network protocol transform function, so the filter contains the network filter, such as the http filter.
   
   The request processing order is as follows.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:
+- listener
+- filter
+- route
+- cluster
+
+#### listener
+
+Listener provides external network server function which support many network protocol, such as http, http2 or tcp.
+
+User can set the protocol and host to allow pixiu listen to it.
+
+When listener receives request from client, it will handle it and pass it to filter.

Review comment:
       When listener receives request from client, it will process it and pass it to the 'filter'.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.

Review comment:
       记着在小标题下面开一个空格行,然后开始写文字.
   
   The static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. The dynamic_resource is still in developing now.

##########
File path: docs/user/config.md
##########
@@ -0,0 +1,130 @@
+
+
+### Config
+ 
+Pixiu supports specifying local config file with argument -c which you can find in those samples pixiu dir. 
+
+Pixiu use the config abstraction like envoy such as listener, filter, route and cluster.
+
+Besides, pixiu provides another dubbo-specific config named api_config which dubbo-filter used to  transform http request to dubbo generic call. you can find it in those samples pixiu dir too.
+
+The api_config specification you can refer to this document [Api Model](api.md).
+
+This document mainly describes the pixiu config abstraction, there is a example below:
+```yaml
+
+static_resources:
+  listeners:
+    - name: "net/http"
+      address:
+        socket_address:
+          protocol_type: "HTTP"
+          address: "0.0.0.0"
+          port: 8888
+      filter_chains:
+        - filter_chain_match:
+          domains:
+            - api.dubbo.com
+            - api.pixiu.com
+          filters:
+            - name: dgp.filter.httpconnectionmanager
+              config:
+                route_config:
+                  routes:
+                    - match:
+                        prefix: "/user"
+                      route:
+                        cluster: "user"
+                        cluster_not_found_response_code: 505
+                http_filters:
+                  - name: dgp.filter.http.httpproxy
+                    config:
+                  - name: dgp.filter.http.response
+                    config:
+  clusters:
+    - name: "user"
+      lb_policy: "lb"
+      endpoints:
+        - id: 1
+          socket_address:
+            address: 127.0.0.1
+            port: 1314
+```
+The more detail will be found in pkg/model/bootstrap.go
+
+### static_resources 
+the static_resources are used to specify unchanged config, meanwhile the dynamic_resources are used for dynamic config. supporting dynamic_resource is still in develop.
+
+There are four import abstraction in static_resources:

Review comment:
       There are four import abstraction in the 'static_resources' now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org