how to check, if the server can handle curl connection thru proxy AND validate proxies from the list?
how to check, if the开发者_如何学运维 server can handle curl connection thru proxy AND validate proxies from the list?
cURL requests can simulate exactly a normal request from any browser, so there is no difference on how servers respond to cURL.
Whether or not the server accepts a proxy connection depends on if your proxy is transparent or not. A transparent proxy disguises itself so there is no evidence the connection is coming from a proxy. A non-transparent proxy will provide X-PROXY-* headers in the HTTP request.
To test whether the proxy works, simply set the CURL_PROXYTYPE to the type of proxy you are using, CURL_PROXY option to the proxy host, and CURL_PROXYPORT to the proxy's port.. and make a normal request.
精彩评论