> For the complete documentation index, see [llms.txt](https://docs.ipdunar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipdunar.com/products/overview-2/protocols.md).

# Protocols

Each ISP IP supports HTTP, HTTPS, and SOCKS5 on the same port (`8000`). The protocol is auto-detected from your client handshake — there's nothing to configure per IP.

## HTTP / HTTPS

```bash
# HTTP target
curl -x http://ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 http://example.com

# HTTPS target (end-to-end TLS)
curl -x http://ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 https://example.com
```

For HTTPS targets the client sends `CONNECT example.com:443` to the proxy, which opens a TCP tunnel. ipdunar never sees the request body.

## SOCKS5

```bash
curl --socks5-hostname ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 \
     https://ipv4.icanhazip.com
```

Use `--socks5-hostname` (curl) or `socks5h://` (Python `requests`, others) to make the proxy do DNS — otherwise your local resolver leaks DNS and breaks geo-based services.

### Python

```python
import requests
proxy = "socks5h://ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000"
r = requests.get("https://ipv4.icanhazip.com",
                 proxies={"http": proxy, "https": proxy}, timeout=30)
```

### Node.js

```js
import { SocksProxyAgent } from "socks-proxy-agent";
import fetch from "node-fetch";
const agent = new SocksProxyAgent("socks5://ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000");
const res = await fetch("https://ipv4.icanhazip.com", { agent });
```

## When to prefer which

The trade-offs are the same as residential. See [Residential protocols](https://docs.ipdunar.com/products/overview/protocols.md#when-to-prefer-which) for the full table.

## ISP-specific notes

* **HTTP/2 to the target** works through the `CONNECT` tunnel. ipdunar does not downgrade.
* **Long-lived connections** — ISP IPs are stable, so connection pools (HTTP keep-alive, HTTP/2 multiplexing) pay off handsomely. Hold connections; don't reconnect per request.
* **WebSocket and gRPC** work; treat the IP as a normal HTTP proxy for these.

## What we do not support

* SOCKS4 / SOCKS4a — use SOCKS5
* Username-encoded targeting (no `-type-`, `-region-`, etc.) — ISP credentials are plain `user:pass`. Anything you try to add to the username will be sent to the gateway as-is and rejected with `407 auth-failed`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ipdunar.com/products/overview-2/protocols.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
