phpcurlproxyhttp-request

Is it possible to differenciate proxy error from endpoint error with php curl


little curl question ^^

You have:

Is it possible when sending requests through proxy with php_curl to remote web site (ex: an API) to differentiate cases when the proxy part failed (ex: proxy down, bad auth, timeout ...) from when the remote web site fails (ex: 404, site down, bad auth, timeout ...)

Thx


Solution

  • See the PHP Curl documenation and/or the libcurl documentation.

    It looks like the only proxy-specific error code is (CURLE_COULDNT_RESOLVE_PROXY) 5