fly-replay and dynamically created Machines

Has anyone had success proxying to Machines created via the machines API and the fly-replay header? I’m trying to do something akin to:

Application A: Receive request, create Machine in Application B
Application A: Wait for Machine to run, register its ID in shared database, forward reference R to caller
Caller: Request R from Proxy Application C
Proxy Application C: Respond with fly-replay: app=Application B;instance=ID

But this doesn’t seem to work, and the proxy responds with no known healthy instances found for route tcp/443. Which is weird, because the machine created in Application B registers only with an internal port of 80, and 443 is only relevant due to Proxy Application C terminating SSL.

My use case here is that Application B may have many dynamically created machines spawned within it, and Proxy Application C is responsible for service discovery from callers. This seemed like a valid use case based on how fly-replay is documented, but this doesn’t seem to be working at all. Has anyone had any luck here, or similar problems?

It sounds like the machines you are creating might not have a service for port 443 with handler tls which is required if you want to receive https traffic. Can you share what services you are setting on the machines?

It definitely doesn’t - the target machine is only port 80, http handler. I had assumed that because SSL was being terminated by the Fly proxy, that I wouldn’t need to have internal instances provide TLS because the proxy had already done the SSL work, and that internally it would forward the request as if it was HTTP. Does fly-replay require the new target to support an identical endpoint as the proxy that received it?

Ah, yep. You need that 443 tls handler. When we replay we send the request along the backhaul as it came, ssl and all.

1 Like

Adding the TLS handler did the trick, thanks very much.

1 Like

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