> ## Documentation Index
> Fetch the complete documentation index at: https://docs.proxies.fo/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> HTTP responses and SOCKS5 reply codes from the Proxies.fo network

Error codes differ by product. Residential and Mobile have a richer set of plan-limit and targeting errors; Datacenter has a tighter set focused on authentication and upstream failures plus SOCKS5 reply codes.

## Residential & Mobile

### Authentication & request errors

<ResponseField name="400 Bad Request" type="standard">
  Your HTTP request is malformed. Check your proxy client is sending a valid HTTP CONNECT or request line.
</ResponseField>

<ResponseField name="407 Proxy Authentication Required" type="standard">
  Username or password is wrong, or your targeting modifiers contain an unrecognised value.

  Body: `Incorrect username or password`
</ResponseField>

<ResponseField name="417 Expectation Failed" type="standard">
  Your client sent an `Expect:` header the proxy can't satisfy. Remove it or switch libraries.
</ResponseField>

### Plan limit errors

<ResponseField name="452 Bandwidth Exceeded" type="custom">
  You've used all the bandwidth on your plan. Top up or upgrade from the dashboard.

  Body: `exceeded bandwidth limit`
</ResponseField>

<ResponseField name="453 Thread Limit Exceeded" type="custom">
  You're making more concurrent connections than your plan allows. Lower concurrency or upgrade.

  Body: `exceeded threads limit`
</ResponseField>

### Targeting errors

<ResponseField name="454 Invalid Country Code" type="custom">
  The `country-<code>` modifier isn't a recognised country. Use lowercase ISO 3166-1 alpha-2 codes (e.g. `us`, `de`, `jp`).

  Body: `invalid country code`
</ResponseField>

<ResponseField name="454 Invalid State Code" type="custom">
  The `state-<code>` value isn't recognised for the country (residential only). Use the standard regional subdivision code.

  Body: `invalid state code`
</ResponseField>

<ResponseField name="454 Invalid City Code" type="custom">
  The `city-<n>` value isn't recognised, or no IPs are available (residential only). City names should be lowercase and concatenated (`westlakevillage`).

  Body: `invalid city code`
</ResponseField>

<ResponseField name="454 Invalid ASN" type="custom">
  The `asn-<number>` value isn't in the supported set, or no IPs are available for the combined geo + ASN targeting. Verify the ASN with `whois` or bgp.he.net.

  Body: `invalid asn`
</ResponseField>

<ResponseField name="455 Invalid TTL" type="custom">
  The `ttl-<minutes>` value is outside the allowed range. TTL must be a positive integer within the supported lifetime range.

  Body: `invalid ttl`
</ResponseField>

### Upstream errors

<ResponseField name="502 Bad Gateway" type="standard">
  The target site couldn't be reached. DNS failure, target-side refusal, or a transient network issue. Retry with backoff.
</ResponseField>

<ResponseField name="500 Internal Server Error" type="standard">
  An unexpected error occurred. If you see this repeatedly, reach out via the [dashboard](https://app.proxies.fo/signin) with a timestamp.
</ResponseField>

<ResponseField name="503 Service Unavailable" type="standard">
  A transient internal error. Retry with backoff — if it persists, contact support.
</ResponseField>

### Residential & Mobile summary

| Code | Meaning                              | Action                               |
| ---- | ------------------------------------ | ------------------------------------ |
| 400  | Bad request                          | Fix client request format            |
| 407  | Auth failed                          | Check username / password            |
| 417  | Expectation failed                   | Remove `Expect:` header              |
| 452  | Bandwidth exhausted                  | Top up plan                          |
| 453  | Thread limit hit                     | Lower concurrency or upgrade         |
| 454  | Invalid country / state / city / ASN | Fix targeting modifier               |
| 455  | Invalid TTL                          | Use a valid `ttl-<minutes>` value    |
| 500  | Internal error                       | Contact support                      |
| 502  | Upstream unreachable                 | Retry with backoff                   |
| 503  | Service unavailable                  | Retry; contact support if persistent |

<Note>
  Mobile only accepts `country-` and `asn-` targeting, so `454 invalid state/city code` won't apply to mobile.
</Note>

***

## Datacenter (HTTP)

<ResponseField name="400 Bad Request" type="standard">
  Malformed authentication — typically a bad Base64-encoded `Proxy-Authorization` header. Your client is sending credentials in the wrong format. Regenerate or re-encode.
</ResponseField>

<ResponseField name="407 Proxy Authentication Required" type="standard">
  Missing, invalid, expired, or capped credentials. Common causes: wrong username/password, expired session credentials, plan bandwidth or thread limit reached, account suspended.
</ResponseField>

<ResponseField name="500 Internal Server Error" type="standard">
  Server-side error **after** authentication succeeded. Inspect the `X-Server-Error` response header for a more specific reason.

  ```
  curl -v -x "http://user:pass@dcp-eu.proxies.fo:10808" https://api.ipify.org
  # Look for: < X-Server-Error: <reason>
  ```
</ResponseField>

### Datacenter HTTP summary

| Code | Meaning                        | Action                                |
| ---- | ------------------------------ | ------------------------------------- |
| 400  | Bad auth encoding              | Check Base64 of `Proxy-Authorization` |
| 407  | Auth failed / expired / capped | Verify creds and plan status          |
| 500  | Post-auth server error         | Inspect `X-Server-Error` header       |

## Datacenter (SOCKS5)

SOCKS5 replies use single-byte reply codes. Most libraries surface these as descriptive errors automatically.

| Code | Meaning               | Action                                      |
| ---- | --------------------- | ------------------------------------------- |
| 0    | Succeeded             | —                                           |
| 1    | Network unreachable   | Retry with backoff                          |
| 2    | Host unreachable      | Check target availability                   |
| 3    | Connection refused    | Target rejected — check port / target state |
| 4    | Command not supported | Use `CONNECT` or `UDP ASSOCIATE` only       |

***

## Handling errors in code

<CodeGroup>
  ```python Python (residential / mobile) theme={null}
  import requests

  proxy = "http://adminpcowe-country-zz:maskxsndyb@pr-us.proxies.fo:13337"
  proxies = {"http": proxy, "https": proxy}

  try:
      r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
      if r.status_code == 454:
          print("Targeting error:", r.text.strip())
      elif r.status_code == 452:
          print("Out of bandwidth — top up your plan")
      elif r.status_code == 453:
          print("Too many concurrent connections")
      elif r.status_code >= 500:
          print(f"Upstream issue ({r.status_code}) — retry with backoff")
      else:
          print(r.text)
  except requests.exceptions.ProxyError as e:
      print("Auth failed — check credentials:", e)
  ```

  ```python Python (datacenter) theme={null}
  import requests

  proxy = "http://adminywsve:jwqcoz4lfm@dcp-eu.proxies.fo:10808"
  proxies = {"http": proxy, "https": proxy}

  try:
      r = requests.get("https://api.ipify.org", proxies=proxies, timeout=30)
      if r.status_code == 500:
          print("Post-auth error:", r.headers.get("X-Server-Error", "unknown"))
      elif r.status_code == 407:
          print("Auth failed or plan capped — check dashboard")
      elif r.status_code == 400:
          print("Bad auth encoding — check Proxy-Authorization header")
      else:
          print(r.text)
  except requests.exceptions.ProxyError as e:
      print("Connection failed:", e)
  ```
</CodeGroup>

## Still stuck?

Best support is through the [dashboard](https://app.proxies.fo/signin) — fastest response time. You can also reach us on [Discord](https://discord.gg/proxy), [Telegram](https://t.me/prodigynet), or by email at [admin@proxies.fo](mailto:admin@proxies.fo). Include a request timestamp and the full response when reporting an issue.
