Imported Google Group message.
Date:Thursday, 3 December 2015 14:57:35 UTC.
I see - that’s a tricky one. Target switching isn’t supported at the moment, you’d need a separate API on the same domain with a different listen_path to target different machines, but that wouldn’t give you the same base URL.
You could try something deeply insane:
Set up three APIs: One that points at the Tyk gateway (it reverses on itself) - lets call this the Splitter API, One that points at your machine set A and one that points at Machine set B
In the first API, you set up rewrites that take a meta_data value associated with the User Session (their token data), just make it something like target_path and make the value the listen path of either Machine Set A or B.
Then you can use a custom middleware component on the Splitter API to rewrite the path to the listen path of API A or B based on this meta data value.
Basically what would happen is, users would target the splitter with their keys, which would then route their traffic via one of the two other APIs based on some value associated with their token, all inside Tyk, proxying the proxy.
You could go a step further and set this first API to not track analytics so you have only stats or A and B in your dashboard.
I really have no idea if that would work, but it would be awesome if it did