i want my server to act as a middleware between the client and another server, the problem is that the target server have a dynamic subdomains that changes everytime randomly
i've tried http-proxy-middleware already, it works well with non dynamic targets, but i could't do any better
var options = {
target: 'https://123.cdn.me', // target host
changeOrigin: true,
ws: true,
pathRewrite: {
'^/download/': '/'
}
};
// create the proxy (without context)
var exampleProxy = proxy(options);
app.use('/download', exampleProxy);
`
i need a way to proxify requests from x1.myserver.com, to x1.traget_server.com and x2.myserver.com to x2.traget_server.com with x1,x2 a random values that should work at runtime and be added dynamically