Skip to content

Instantly share code, notes, and snippets.

@timshadel
Created November 16, 2012 21:45
Show Gist options
  • Save timshadel/4091183 to your computer and use it in GitHub Desktop.
Save timshadel/4091183 to your computer and use it in GitHub Desktop.

Ask curl to connect to localhost, but send the Host header with a different value

$ curl -H "Host: fake.com" http://localhost:8585

curl will hang until you kill the server.

Start a TCP server that simply echoes everything to the console $ nc -l 8585

Once the client connects, you should see this output.

GET / HTTP/1.1
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
Accept: */*
Host: fake.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment