Replay with request modification

Hi everyone,

the fly request header is quite useful, and I’ve been testing it for some gateway-like methods.

One thing I would consider useful is request modification. A good example would be rewriting the target URL of an HTTP request. This way, one could use the entry point app to assemble different apps using namespaces. Before replaying the request to the target instance or app, and the gateway could remove the namespace or add add headers for authentication etc.

Do you think that would be useful as well? Is it technically feasible?

From How To to Questions / Help

I believe we had a very similar case on an internal app here at Fly.io

We solved auth in this case using fly-replay-src: Dynamic Request Routing · Fly Docs

  1. Machine A receives a request. Checks which machine to route to and apply state=foo to the Fly Replay header.
  2. Fly proxy replays to Machine B with Fly-Replay-Src containing state=foo.

By verifying the Fly-Replay-Src header state (which was really a Phoenix.Token) we verified auth was correct and applied it to our Machine B like any other header.

Maybe that solves your use case?

Not really. I know you can hide information in fly-replay-src, but that only works if you are in full control over the receiver processing. Most HTTP headers, some also used for authentication, are standardized and the corresponding programs and libraries use them. For instance, even if I could, I would not modify the URL path handlers in my web framework to search a fly.io specific header, for many reasons (portability, effort, …). Binary, not open source, programs usually can’t be adjusted that way either.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.