I am trying to take complete control of the target routing. I would like the proxied request to be aborted before the client socket is opened if my router was unable to determine a target host. Is this possible to do?
createProxyMiddleware({
// target is a required parameter
target: 'do-not-use',
router: (req) => {
try {
...
return target;
}
catch (err) {
req.res.sendStatus(500);
}
},
});
The current http-proxy code will still use the original target "do-not-use". I would rather the proxy just abort the request entirely if the router function does not return a target.
I am trying to take complete control of the target routing. I would like the proxied request to be aborted before the client socket is opened if my router was unable to determine a target host. Is this possible to do?
The current http-proxy code will still use the original target "do-not-use". I would rather the proxy just abort the request entirely if the router function does not return a target.