proxy-mirror
note
The response returned by the mirror request is ignored.
You can customize the proxy timeouts for the mirrored sub-requests by configuring the plugin_attr
key in your configuration file (conf/config.yaml
). This can be used for mirroring traffic to a slow backend.
You can enable the Plugin on a specific Route as shown below:
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
"plugins": {
"proxy-mirror": {
"host": "http://127.0.0.1:9797"
}
},
"upstream": {
"127.0.0.1:1999": 1
},
"type": "roundrobin"
"uri": "/hello"
}'
We can specify the timeout
for subrequests in plugin_attr
in conf/config.yaml
. This is useful in connection reuse scenarios when mirroring traffic to a very slow backend service.
tip
For testing you can create a test server by running:
python -m http.server 9797
Once you have configured the Plugin as shown above, the requests made will be mirrored to the configured host.
HTTP/1.1 200 OK
hello world