# Connect to datacenter proxies

Get the IPs, credentials and ports of a datacenter proxy service through the API, then connect with curl, Python or Node.js using login/password or an IP allowlist.

- Canonical: https://fineproxy.org/developers/docs/proxies/datacenter/

This page shows how to turn a datacenter proxy service into working proxy connections: read its IPs and credentials from the API, pick a protocol and port, and connect from curl, Python or Node.js.

## How a service maps to proxies

A datacenter service is a set of dedicated IPv4 addresses — for example, 100 IPs in Germany. **Each IP is its own proxy endpoint**: you connect to the IP you want your traffic to exit from. All IPs of a service share:

- one username and password;
- the same set of ports and protocols;
- one IP allowlist.

You need the service ID (UUID) from `GET /api/v1/customer/services`. The examples below use `$SERVICE_ID`.

## Get the IPs

```bash
curl https://fineproxy.org/account_new/api/v1/customer/services/$SERVICE_ID/proxy/ips \
  -H "Authorization: Bearer $FINEPROXY_API_KEY"
```

The response lists every IP of the service with its country:

```json
{
  "service_id": "00000000-0000-0000-0000-000000000000",
  "ips": [
    { "ip": "203.0.113.10", "country": "DE", "type": "socks5", "site": "nyc-1" },
    { "ip": "203.0.113.11", "country": "DE", "type": "socks5", "site": "nyc-1" }
  ],
  "geo_source": "maxmind"
}
```

Use `ip` as the proxy host. Every IP accepts all protocols listed by `proxy/auth` below, whatever the `type` field says.

## Get credentials and endpoints

`GET .../proxy/auth` returns the username, the ports and the allowlist. The password is masked by default; add `reveal=true` to receive it in plain text.

```bash
curl "https://fineproxy.org/account_new/api/v1/customer/services/$SERVICE_ID/proxy/auth?reveal=true" \
  -H "Authorization: Bearer $FINEPROXY_API_KEY"
```

```javascript
const res = await fetch(
  `https://fineproxy.org/account_new/api/v1/customer/services/${process.env.SERVICE_ID}/proxy/auth?reveal=true`,
  { headers: { Authorization: `Bearer ${process.env.FINEPROXY_API_KEY}` } },
);
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const auth = await res.json();
console.log(auth.username, auth.endpoints.map((e) => `${e.protocol}:${e.port ?? '-'}/${e.port_whitelist}`));
```

```python
import os
import requests

res = requests.get(
    f"https://fineproxy.org/account_new/api/v1/customer/services/{os.environ['SERVICE_ID']}/proxy/auth",
    params={"reveal": "true"},
    headers={"Authorization": f"Bearer {os.environ['FINEPROXY_API_KEY']}"},
    timeout=30,
)
res.raise_for_status()
auth = res.json()
print(auth["username"], [(e["protocol"], e.get("port"), e["port_whitelist"]) for e in auth["endpoints"]])
```

Example response:

```json
{
  "username": "fine_0123456789ab",
  "password": "your_proxy_password",
  "protocols": ["socks5", "http", "https"],
  "endpoints": [
    { "protocol": "socks5", "label": "SOCKS5", "scheme": "socks5", "port": 1080, "port_whitelist": 1085, "http2": false, "udp": true, "noauth_only": false },
    { "protocol": "http", "label": "HTTP", "scheme": "http", "port": 8080, "port_whitelist": 8085, "http2": false, "udp": false, "noauth_only": false },
    { "protocol": "https", "label": "HTTPS (HTTP/2)", "scheme": "https", "port": 8443, "port_whitelist": 8444, "http2": true, "udp": false, "noauth_only": false, "hostname_template": "net-{ip_dashed}.mcccx.com" },
    { "protocol": "socks4", "label": "SOCKS4", "scheme": "socks4", "port_whitelist": 1087, "http2": false, "udp": false, "noauth_only": true },
    { "protocol": "https_993", "label": "HTTP/2 (port 993, DPI bypass)", "scheme": "https", "port_whitelist": 993, "http2": true, "udp": false, "noauth_only": true, "hostname_template": "net-{ip_dashed}.mcccx.com" }
  ],
  "whitelist_ips": ["198.51.100.7"],
  "password_set": true,
  "udp_enabled": false
}
```

| Field | Meaning |
| --- | --- |
| `username`, `password` | Login and password for the login/password ports. `password` is returned only with `reveal=true`; otherwise check `password_set`. |
| `endpoints[].protocol`, `label`, `scheme` | Protocol identifier, human-readable name and URL scheme to use in proxy URLs |
| `endpoints[].port` | Port for login/password authentication. Absent when `noauth_only` is `true`. |
| `endpoints[].port_whitelist` | Port for IP allowlist authentication (no credentials) |
| `endpoints[].noauth_only` | `true` if the protocol works only through the allowlist |
| `endpoints[].http2` | The proxy speaks HTTP/2 over TLS on this endpoint |
| `endpoints[].udp` | The protocol can carry UDP; `udp_enabled` shows whether UDP is enabled on your service |
| `endpoints[].hostname_template` | Hostname to connect to instead of the bare IP; replace `{ip_dashed}` with the IP, dots replaced by dashes |
| `whitelist_ips` | IPs currently on the allowlist |

> **Important:** The password gives full proxy access. Request `reveal=true` only where you need it, and never log the response.

## Ports and protocols

| Protocol | Login/password port | Allowlist port | Notes |
| --- | --- | --- | --- |
| SOCKS5 | 1080 | 1085 | Use remote DNS (`socks5h://`, `--socks5-hostname`) |
| HTTP | 8080 | 8085 | Standard HTTP proxy |
| HTTPS (HTTP/2) | 8443 | 8444 | TLS to the proxy; connect to the `hostname_template` name, not the IP |
| SOCKS4 | — | 1087 | Allowlist only |
| HTTP/2 on port 993 | — | 993 | Allowlist only; for networks with deep packet inspection (DPI); uses `hostname_template` |

These are the ports returned today. Build connections from `endpoints[]` instead of hardcoding them.

For the HTTPS endpoints, the TLS certificate is issued for the `hostname_template` name. For the IP `203.0.113.10`, connect to `net-203-0-113-10.mcccx.com`.

## Choose an authentication method

Each protocol has two ports, one per authentication method:

- **Login and password** (`port`) — send the username and password with every connection. Works from any network; best for servers with changing IPs, laptops and CI.
- **IP allowlist** (`port_whitelist`) — no credentials; the proxy accepts connections only from IPs on the service's allowlist. Best for fixed servers and for tools that cannot send proxy credentials. SOCKS4 and HTTP/2 on port 993 work only this way.

New orders require at least one allowlist IP, so the allowlist ports work right after purchase from the machine you listed. To manage entries, see [Manage the IP allowlist](/developers/docs/guides/ip-allowlist/).

## Connect with curl

The examples use these variables:

```bash
export PROXY_USER="fine_0123456789ab"
export PROXY_PASS="your_proxy_password"
export PROXY_IP="203.0.113.10"
```

SOCKS5 with login and password. `--socks5-hostname` resolves the target hostname on the proxy side:

```bash
curl --socks5-hostname "$PROXY_USER:$PROXY_PASS@$PROXY_IP:1080" https://api.ipify.org
```

HTTP proxy with login and password:

```bash
curl -x "http://$PROXY_USER:$PROXY_PASS@$PROXY_IP:8080" https://api.ipify.org
```

HTTPS proxy (TLS to the proxy) — use the hostname from `hostname_template`:

```bash
curl -x "https://$PROXY_USER:$PROXY_PASS@net-203-0-113-10.mcccx.com:8443" https://api.ipify.org
```

SOCKS5 through the IP allowlist — no credentials, from an allowlisted machine:

```bash
curl --socks5-hostname "$PROXY_IP:1085" https://api.ipify.org
```

Each command prints the proxy IP — the address your traffic exits from.

> **Note:** If your password contains characters such as `@`, `:` or `/`, URL-encode it in proxy URLs.

## Connect from code

Python uses `requests`; SOCKS support needs the extra: `pip install "requests[socks]"`. Use the `socks5h://` scheme so that DNS is resolved by the proxy. Node.js uses [`undici`](https://www.npmjs.com/package/undici) for HTTP proxies and [`socks-proxy-agent`](https://www.npmjs.com/package/socks-proxy-agent) for SOCKS5.

HTTP proxy:

```javascript
// npm install undici
import { fetch, ProxyAgent } from 'undici';

const { PROXY_USER, PROXY_PASS, PROXY_IP } = process.env;
const dispatcher = new ProxyAgent({
  uri: `http://${PROXY_IP}:8080`,
  token: `Basic ${Buffer.from(`${PROXY_USER}:${PROXY_PASS}`).toString('base64')}`,
});

const res = await fetch('https://api.ipify.org', { dispatcher });
console.log(await res.text());
```

```python
import os
from urllib.parse import quote

import requests

user, password, ip = os.environ["PROXY_USER"], os.environ["PROXY_PASS"], os.environ["PROXY_IP"]
proxy = f"http://{quote(user, safe='')}:{quote(password, safe='')}@{ip}:8080"

res = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=30)
print(res.text)
```

SOCKS5:

```javascript
// npm install socks-proxy-agent
import https from 'node:https';
import { SocksProxyAgent } from 'socks-proxy-agent';

const { PROXY_USER, PROXY_PASS, PROXY_IP } = process.env;
const agent = new SocksProxyAgent(
  `socks5h://${encodeURIComponent(PROXY_USER)}:${encodeURIComponent(PROXY_PASS)}@${PROXY_IP}:1080`,
);

https.get('https://api.ipify.org', { agent }, (res) => {
  res.setEncoding('utf8');
  res.on('data', (chunk) => process.stdout.write(chunk));
});
```

```python
# pip install "requests[socks]"
import os
from urllib.parse import quote

import requests

user, password, ip = os.environ["PROXY_USER"], os.environ["PROXY_PASS"], os.environ["PROXY_IP"]
proxy = f"socks5h://{quote(user, safe='')}:{quote(password, safe='')}@{ip}:1080"

res = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=30)
print(res.text)
```

To spread load across the service, keep the IP list from `GET .../proxy/ips` and pick a different `ip` per connection or per worker; the credentials and ports stay the same.

## Change the proxy password

Rotate the password when it may have leaked or when someone should lose access:

```bash
curl -X PUT https://fineproxy.org/account_new/api/v1/customer/services/$SERVICE_ID/proxy/auth \
  -H "Authorization: Bearer $FINEPROXY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rotate_password": true}'
```

The response contains the new password — it is returned only once, so store it right away (you can read it again later with `GET .../proxy/auth?reveal=true`). The old password stops working — possibly after a short delay while the change reaches all proxies — so update your clients right away. Through MCP, the same action is the `rotate_proxy_credentials` tool. Both require the `services:write` scope.

## Troubleshooting

| Symptom | Likely cause and fix |
| --- | --- |
| `407 Proxy Authentication Required`, SOCKS5 authentication failure | Wrong username or password, or the password was rotated. Read the current credentials with `GET .../proxy/auth?reveal=true`. URL-encode special characters. |
| Timeout or connection refused on `1085`, `8085`, `8444`, `1087` or `993` | Allowlist ports accept only allowlisted IPs. Check your current public IP (MCP tool `get_my_ip`) and compare it with `GET .../proxy/whitelist`. Behind NAT, a VPN or a cloud load balancer, your outgoing IP may differ from what you expect. |
| Credentials rejected on an allowlist port | Allowlist ports do not take credentials. Use `port` for login/password and `port_whitelist` for the allowlist. |
| TLS or certificate error on `8443` | Connect to `net-<ip-with-dashes>.mcccx.com` from `hostname_template`, not to the bare IP. |
| Timeouts from a cloud server or another datacenter | Some hosting providers filter outgoing connections to non-standard ports. Test the same command from another network; if it works there, ask your provider to allow outbound traffic to the proxy ports. |
| Everything fails for a service that used to work | Check `status` in `GET /api/v1/customer/services/{service_id}`: an expired, suspended or cancelled service may still list its IPs, but connections fail. |

For per-service error statistics, use the MCP tool `get_diagnostics`, which breaks failed requests down by cause.

## Next steps

- [Manage the IP allowlist](/developers/docs/guides/ip-allowlist/) — connect without credentials.
- [Rotating proxies](/developers/docs/proxies/rotating/) — gateway-based proxies with a request quota.
- [Proxy access API reference](/developers/docs/api/proxy-access/) — every endpoint used on this page.
