Question

I'm am trying to access a webpage using an HTTP proxy with curl and php. I want to make the request look as close as possible to a real browser, however when I send the GET request through CURL, it sends the header "Proxy-Connection: Keep-Alive" even when I haven't specified it. How can I remove "Proxy-Connection: Keep-Alive" from the sent headers?

Was it helpful?

Solution

Try the -H parameter without specifying a value for the internal headers you want to remove:

curl -H "Proxy-Connection:" http://somehost

OTHER TIPS

If you're using recent version of curl, you should use --proxy-header option:

curl --proxy-header "Proxy-Connection:" http://somehost

This is CURLOPT_PROXYHEADER option in php which available starting from php 7.0.7.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top