Browser running in docker container needs to make a POST to a login service running on a test API in our network. The service is very picky about where POST can come from so it’s rejecting the POST because it’s coming from
host.docker.internal instead of
It’s very unlikely I’d be able to get
host.docker.internal added to the whitelist.
The POST will work fine if the browser is running on my local machine but fails when the browser is running inside a container on my local machine.
docker run --add-host='localhost.mycompany.com:127.0.0.1' and
docker run --add-host='localhost:127.0.0.1', neither one worked. The latter seems silly; it was kind of a shot in the dark…
Possible further complication: the browser is running in testcafe inside a docker container, so my request will have an headers like
Short of making a proxy of some sort on my local machine, is there a way to make a POST from the docker container appear to be coming from my local machine?