[service]
external_ip="192.168.1.4"
disable_upgrade_insecure_requests=true
[service.ratelimiter]
type="service"
period="1s"
burst=2
[[service.interfaces.http]]
address="0.0.0.0:8180"
[[service.interfaces.https]]
address="0.0.0.0:8181"
ssl_cert="ca/cert.pem"
ssl_key="ca/server.key.pem"
[[service.interfaces.tcp]]
address="0.0.0.0:8182"
[service.multi_thread]
event_interval=61              
thread_name="gateway_thread_"
thread_stack_size=81920        
global_queue_interval=128   
max_blocking_threads=512       
nevents=1024                  
core_threads=8
bind_cpu="all"
[service.current_thread]
event_interval=61              
thread_name="gateway_thread_"
thread_stack_size=81920        
global_queue_interval=128   
max_blocking_threads=512       
nevents=1024                  
core_threads=8
bind_cpu="4"
[service.cache.memory]
clear_time_interval="10min"
[service.cache.redis]
ip="49.232.72.55"
port=6379
pwd="123456"

[hosts]
[hosts.httpbin]
type="round_robin"
error="test1"
servers=[
    "open.qingting.fm:80 timeout=20s weight=3 max_fails_durn=5min max_fails=10 fail_timeout=9s"
]
[hosts.httpsbin]
type="round_robin"
servers=[
    "restapi.amap.com:443 timeout=20s weight=3 max_fails_durn=5min max_fails=10 fail_timeout=9s"
]
[hosts.tcpbin]
type="ip_round_robin"
servers=[
    "110.242.68.247:80"
]

[pipes]
[[pipes.http_pipe]]
[pipes.http_pipe.black_white_list]
black_list.memory=[
    "127.0.0.1-127.0.0.255"
]
black_list.file="examples/test.txt"
white_list.memory=[
    "127.0.0.1-127.0.0.255",
    "192.168.1.1-192.168.1.255"
]
white_list.file="examples/test.txt"
[[pipes.http_pipe]]
[pipes.http_pipe.ratelimiter]
type="service"
[[pipes.http_pipe]]
[pipes.http_pipe.memory_cache_get]
hit=3
expire="3min"
back=true
[[pipes.http_pipe]]
[pipes.http_pipe.header_request]
add=[
    {rwp="rockwaypoint"}
]
del=[
    "abc",
    "hohoho",
]
[[pipes.http_pipe]]
dispatche="rwp"
[[pipes.http_pipe]]
[pipes.http_pipe.header_response]
add=[
    {Connection="keep-alive"},
    {Access-Control-Allow-Origin="*"},
    {Access-Control-Allow-Headers="origin, content-type, accept"},
    {Access-Control-Allow-Methods="GET, POST, PUT, DELETE"},
]
[[pipes.http_pipe]]
[pipes.http_pipe.memory_cache_set]
hist=0
expire="3min"
[[pipes.http_pipe]]
return="rwp"

[[pipes.tcp_pipe]]
dispatche="rwps"

[routes]
[routes.http_test]
protocol="http"
priority=999
pipe="http_pipe"
[routes.http_test.ratelimiter]
type="route"
period="1s"
burst=2
[routes.http_test.in]
type="regex"
pattern="^/w*"
method=["GET","POST"]
[routes.http_test.out]
type="network"
path="/"
out_host="httpbin"
[routes.https_test]
protocol="https"
priority=80
pipe="http_pipe"
[routes.https_test.ratelimiter]
type="route"
period="1s"
burst=2
[routes.https_test.in]
type="regex"
pattern="^/w*"
method=["GET","POST"]
[routes.https_test.out]
type="network"
path="/"
out_host="httpsbin"
[routes.tcp_test]
protocol="tcp"
priority=3
pipe="tcp_pipe"
in_timeout="5000ms"
client_buf_size=2048
server_buf_size=128
[routes.tcp_test.in]
type="ip"
ranges=[
    "127.0.0.1-127.0.0.1",
    "192.168.1.0-192.168.1.255"
]
[routes.tcp_test.out]
type="network"
out_host="tcpbin"

[errors]
[errors.test1]
type="http"
error_list="hsc_404 hsc_500 hsc_504"
pass_next=true
return="hsc_404"