0

I run the cmd:

curl http://fbvn.org --proxy 171.229.106.254:21217

=> It works

But:

curl http://171.229.106.254:21217 -H 'host: fbvn.org' -H 'connection: close'

Or

curl http://171.229.106.254:21217/http://fbvn.org -H 'host: fbvn.org' -H 'connection: close'

Both don't work and get error: 'Invalid header received from client.'

I don't know why, am I missing any http header?

1 Answers1

2

Yes, how to communicate via a HTTP proxy is defined in the HTTP protocol spec. The client then connects to the proxy and asks that for the remote URL.

One way to see how curl does it, is to add --trace-ascii dump.txt to the command line and it'll save the entire request and response for you to investigate and learn from.

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222