Pretty big new feature (#160): you can now optionally open server ports for which every request made to that port gets forwarded to 1+ destination URLs and the combined data is returned.
This is using the new -M
multi flag (or as a library fhttp.MultiServer
)
For instance fortio proxies -M "5554 http://svc1:8080/echo http://svc2:8080/echo"
will forward incoming requests on 5554 to svc1 and svc2.
By default all headers and request type (URI, query args, method (POST vs GET), payload etc) are mirrored, alternatively if you pass -multi-mirror-origin=false
then only distributed tracing headers are passed and the target request is as specified
See an example https://github.com/fortio/fortio#using-the-http-fan-out--multi-proxy-feature