# What Proxy Types Does Holehe Support? HTTP, SOCKS4, and SOCKS5 Explained

> Discover the proxy types Holehe supports including HTTP SOCKS4 and SOCKS5. Learn how to leverage these protocols for enhanced security and anonymity in your projects.

- Repository: [Palenath/holehe](https://github.com/megadose/holehe)
- Tags: how-to-guide
- Published: 2026-08-16

---

**Holehe supports three proxy types: HTTP, SOCKS4, and SOCKS5**, with SOCKS protocols requiring the optional `pysocks` dependency.

Holehe is an open-source OSINT tool by megadose that checks if an email address is registered on various websites. For users operating in restricted network environments or requiring anonymity, understanding holehe's proxy capabilities is essential. This article examines the proxy implementation in the megadose/holehe repository, covering supported protocols, command-line usage, and underlying code architecture.

## HTTP Proxy Support

The **HTTP proxy** is the default and most straightforward option. Holehe passes HTTP proxy URLs directly to Python's `requests` library without additional dependencies.

In [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py), the `--proxy` argument accepts standard URL formats:

```bash

# HTTP proxy for all traffic

holehe -u example@example.com --proxy http://127.0.0.1:8080

# HTTP proxy with authentication

holehe -u example@example.com --proxy http://user:pass@127.0.0.1:8080

```

The proxy string is parsed around **lines 108–116** of [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py), where it builds a `proxies` dictionary mapping both `http` and `https` schemes to the provided URL. This dual mapping ensures all outbound requests route through the proxy regardless of protocol.

## SOCKS4 and SOCKS5 Proxy Support

**SOCKS4** and **SOCKS5** proxies provide lower-level tunneling and support UDP or remote DNS resolution. Holehe implements these through conditional dependency handling:

| Proxy Type | URL Scheme | Requirements |
|------------|-----------|--------------|
| SOCKS4 | `socks4://` | `pysocks` package installed |
| SOCKS5 | `socks5://` | `pysocks` package installed |

The conditional import of `pysocks` occurs near **line 122** of [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py). If SOCKS is requested but `pysocks` is absent, the tool fails with a clear error message directing users to install the dependency.

Usage examples:

```bash

# SOCKS4 proxy

holehe -u example@example.com --proxy socks4://127.0.0.1:1080

# SOCKS5 proxy with remote DNS resolution

holehe -u example@example.com --proxy socks5h://127.0.0.1:1080

```

Note the `socks5h://` variant forces DNS resolution through the proxy, a `requests` feature holehe inherits.

## Proxy Implementation in Source Code

Understanding the architecture helps diagnose connection issues or extend functionality.

### Command-Line Parsing ([`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py))

The `--proxy` argument definition appears around **line 95**:

```python

# Simplified representation based on holehe/core.py structure

parser.add_argument(
    "--proxy",
    help="Proxy URL (http://, socks4://, or socks5://)"
)

```

### Request Layer Integration ([`holehe/instruments.py`](https://github.com/megadose/holehe/blob/main/holehe/instruments.py))

The `proxies` dictionary constructed in [`core.py`](https://github.com/megadose/holehe/blob/main/core.py) propagates to [`holehe/instruments.py`](https://github.com/megadose/holehe/blob/main/holehe/instruments.py), which contains low-level request functions. These functions pass the proxy configuration directly to `requests.Session` objects:

```python

# Conceptual flow from holehe/instruments.py

session = requests.Session()
session.proxies.update(proxies)  # Contains http/https/socks mappings

response = session.get(url, timeout=timeout)

```

### Dependency Specification ([`setup.py`](https://github.com/megadose/holehe/blob/main/setup.py))

The optional SOCKS dependency is declared in [`setup.py`](https://github.com/megadose/holehe/blob/main/setup.py) as an extra:

```ini

# From setup.py extras_require or equivalent

pysocks

```

Install with: `pip install holehe[pysocks]` or `pip install pysocks` separately.

## Programmatic Proxy Configuration

For developers integrating holehe as a library:

```python
import requests
from holehe import core

# Configure session with custom proxy

proxies = {
    "http": "socks5://127.0.0.1:1080",
    "https": "socks5://127.0.0.1:1080"
}

session = requests.Session()
session.proxies.update(proxies)

# Pass to holehe's check functions

# (Specific API depends on version; consult source for current interface)

```

## Proxy Type Selection Guidelines

**Choose HTTP proxies** when:
- Operating simple HTTP/HTTPS traffic interception
- Minimal dependencies are preferred
- The proxy supports CONNECT tunneling for HTTPS

**Choose SOCKS4 proxies** when:
- TCP-level redirection suffices
- UDP and authentication are unnecessary
- Legacy SOCKS4 infrastructure is available

**Choose SOCKS5 proxies** when:
- UDP traffic or remote DNS resolution is required
- Authentication to the proxy server is needed
- Maximum protocol flexibility is desired

## Summary

- **Holehe supports HTTP, SOCKS4, and SOCKS5 proxy types** for routing OSINT requests
- HTTP proxies work out-of-the-box with no additional dependencies
- SOCKS4 and SOCKS5 require the `pysocks` package, specified as an optional dependency
- Proxy configuration flows from `--proxy` argument parsing in [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) through to `requests.Session` objects in [`holehe/instruments.py`](https://github.com/megadose/holehe/blob/main/holehe/instruments.py)
- URL schemes determine proxy type: `http://`, `socks4://`, `socks5://`, or `socks5h://` for SOCKS5 with remote DNS

## Frequently Asked Questions

### Does holehe support authenticated proxies?

Yes. Holehe passes proxy credentials through standard URL syntax (`http://user:pass@host:port` or `socks5://user:pass@host:port`) directly to the `requests` library, which handles authentication negotiation.

### What happens if I specify a SOCKS proxy without installing pysocks?

Holehe detects the missing dependency around **line 122** of [`core.py`](https://github.com/megadose/holehe/blob/main/core.py) and exits with an informative error. Install `pysocks` via `pip install pysocks` or `pip install holehe[pysocks]` to resolve.

### Can holehe use different proxies for HTTP and HTTPS traffic?

The current implementation maps both schemes to the single `--proxy` value. For split proxy configurations, users must modify [`holehe/core.py`](https://github.com/megadose/holehe/blob/main/holehe/core.py) or wrap calls with external tools like `proxychains`.

### Does holehe support HTTP proxies for HTTPS destinations?

Yes. The `requests` library automatically uses HTTP CONNECT tunneling when an HTTP proxy is configured for HTTPS URLs, a behavior holehe inherits without additional configuration.