When a curl test prints 000 for the HTTP status, it has not obtained a final HTTP response code to report. A website did not send an actual HTTP status named 000.

Capture the error as well

This POSIX-shell example prints the final HTTP field, the CONNECT field, and curl's process exit code:

curl --proxy http://203.0.113.10:8080 --noproxy '' --connect-timeout 5 --max-time 15 --silent --show-error --output /dev/null --write-out 'http=%{http_code} connect=%{http_connect}\n' https://example.com/
result=$?
printf 'curl_exit=%s\n' "$result"

Replace the example endpoint with your HTTP proxy or a candidate from the HTTP proxy list. Keep show-error enabled: the error message is often the most useful part. The CONNECT field is relevant when a tunnel is used; it is not a second final status from the website.

Read the combination

  • A failed connection to the proxy can leave the HTTP field at 000.
  • A timeout before receiving a response can do the same.
  • A successful CONNECT response followed by a TLS failure can show connect=200 and http=000.
  • A completed website response such as 403 is different: the request has an actual HTTP response to inspect.

The exact exit code and message narrow the cause. Check whether the failure happened while locating the proxy, opening its port, negotiating the tunnel, or verifying the destination.

Avoid treating every result as a status-only check

A script that saves only http_code throws away the transport error. Save the process result and a sanitized error message with it. Conversely, curl can complete a transfer successfully while the website returns an error status unless you use an appropriate fail option. The HTTP response and the client's execution result answer different questions.

Do not repair 000 by disabling TLS verification or adding a random header. First determine which operation never reached a final response.

ХӀокхунах тера йаззамаш