是否可以使用php curl将代理错误与端点错误区分开来

little curl question ^^

You have:

  • a site web (endpoint.com/request.php)
  • a proxy server (proxy.com:8080)

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

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