Set cURL to use local virtual hosts

Actually, curl has an option explicitly for this: –resolve Instead of curl -H ‘Host: yada.com’ http://127.0.0.1/something use curl –resolve ‘yada.com:80:127.0.0.1′ http://yada.com/something What’s the difference, you ask? Among others, this works with HTTPS. Assuming your local server has a certificate for yada.com, the first example above will fail because the yada.com certificate doesn’t match the 127.0.0.1 … Read more

Why does Microsoft Edge open some local websites, but not others, where the domain name is routed to 127.0.0.1 in hosts file

Your network can block loopback as a security measure in Windows 10. Open a command prompt as administrator, and run this to exempt Edge from a loopback: CheckNetIsolation LoopbackExempt -a -n=”Microsoft.MicrosoftEdge_8wekyb3d8bbwe” (Microsoft.MicrosoftEdge_8wekyb3d8bbwe is the identifier for the Edge app) There’s a blog post here giving more detail: https://blogs.msdn.microsoft.com/msgulfcommunity/2015/07/01/how-to-debug-localhost-on-microsoft-edge/

How to update /etc/hosts file in Docker image during “docker build”

With a more recent version of docker, this could be done with docker-compose and its extra_hosts directive Add hostname mappings. Use the same values as the docker run client –add-host parameter (which should already be available for docker 1.8). extra_hosts: – “somehost:162.242.195.82” – “otherhost:50.31.209.229” In short: modify /etc/hosts of your container when running it, instead … Read more

Wildcards in a Windows hosts file

Acrylic DNS Proxy (free, open source) does the job. It creates a proxy DNS server (on your own computer) with its own hosts file. The hosts file accepts wildcards. Download from the offical website http://mayakron.altervista.org/support/browse.php?path=Acrylic&name=Home Configuring Acrylic DNS Proxy To configure Acrylic DNS Proxy, install it from the above link then go to: Start Programs … Read more