In particular, I am attempting to replicate the behavior of firefox when I set it to use a proxy for https traffic.
From my tests, it appears that Firefox sends a CONNECT request to the proxy, while the following curl command directly sends GET to the proxy.
curl --proxy-basic mydomain.com:8001 https://www.google.com
How can I make curl behave like firefox for testing purposes with respect to the proxy for HTTPS connections?
EDIT1: The issue is not with the User-Agent, because I am not trying to fool the proxy into thinking I am firefox, only to help the proxy function the way it would with Firefox.
I've done this through Firebug.
Once you've installed firebug, follow this steps:
Net
tabRefresh the page
Right-click the URL request you want to simulate
Choose copy as cURL
You have to specify a proxy otherwise thing would not work, do like:
curl -x 127.0.0.1:8888 "httpS://www.example.com/"
— Be sure that you are trying to connect throught HTTPS, otherwise simple get will be sent.curl -p -x 127.0.0.1:8888 "http://www.example.com/"
— That thing will work even with ordinary HTTP resources.Was hard to find any already existing topics on that subject except for this, so maybe I'm answering an already answered question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With