+-------------------+ +----------+ +----------------------------+ +------------------+
| | | | | | | |
| downstream client +--------->+ listener +---------->+ filters (routing decision) +---------->+ upstream cluster |
| | | | | | | |
+-------------------+ +----------+ +----------------------------+ +------------------+
How is routing decision done?
+-------------+ +------------+ +--------------+ +---------------+ +----------------+
| | | | | | | | | |
| TCP filters +-------->+ HCM filter +--------->+ http filters +---------->+ router filter +--------->+ host selection |
| | | | | | | | | |
+-------------+ +------------+ +--------------+ +---------------+ +----------------+
run the following:
fuser -k 8082/tcp
fuser -k 10000/tcp
fuser -k 10004/tcp
go run server_tcp.go&
envoy -c simple_tcp.yaml&
echo hi | nc localhost 10000
fuser -k 8082/tcp
fuser -k 10000/tcp
fuser -k 10004/tcp
go run server.go&
envoy -c simple.yaml&
curl http://localhost:10000 -dhi
note: you can provide route level configuration for a filter
fuser -k 8082/tcp
fuser -k 10000/tcp
fuser -k 10004/tcp
go run server.go&
envoy -c cors.yaml&
curl -XOPTIONS http://localhost:10000 -H"Origin: solo.io" -v
curl -XOPTIONS http://localhost:10000 -H"Origin: example.com" -v
remember: filter order matters.
fuser -k 8082/tcp
fuser -k 10000/tcp
fuser -k 10004/tcp
go run server.go&
envoy -c simple_fault.yaml -l debug&
for i in $(seq 10); do
curl http://localhost:10000 -s -o /dev/null -w "%{http_code}"
echo
done
note: some route level configuration is handled by the router filter
fuser -k 8082/tcp
fuser -k 10000/tcp
fuser -k 10004/tcp
go run server.go&
envoy -c response-header.yaml&
curl http://localhost:10000 -v