Configuring HTTP Timeout Settings in Holehe for Slow Websites: A Complete Guide

Holehe's global timeout defaults to 10 seconds via the -T/--timeout flag, but individual modules may override this with hard-coded values ranging from 1–3 seconds.

Configuring HTTP timeout settings in Holehe ensures reliable email reconnaissance against slow or unresponsive websites. The tool relies on httpx.AsyncClient for asynchronous requests, with timeout behavior controlled at two distinct layers: a configurable global default and module-specific overrides embedded in individual checker functions.


How Holehe Implements HTTP Timeouts

Holehe manages request timeouts through a two-tier architecture in its core execution flow.

Global Timeout Configuration

The primary control point resides in holehe/core.py, where the CLI parser accepts an optional timeout argument:

parser.add_argument("-T","--timeout", type=int , default=10,
                    required=False,dest="timeout",
                    help="Set max timeout value (default 10)")

Following argument parsing, the tool instantiates httpx.AsyncClient with this value:

timeout = args.timeout
client = httpx.AsyncClient(timeout=timeout)

This client instance propagates to every module's checking function. Any request that omits an explicit timeout parameter inherits this global setting.

Per-Module Timeout Overrides

Several modules bypass the global default by supplying explicit timeout arguments to individual client.get() or client.post() calls. These hard-coded values take precedence over the client-level default:

Module File Path Hard-Coded Timeout
MySpace holehe/modules/social_media/myspace.py 2 seconds
CaringBridge holehe/modules/medical/caringbridge.py 3 seconds
OnlineSequencer holehe/modules/forum/onlinesequencer.py 1 second
Cracked.to holehe/modules/forum/cracked_to.py 1 second

When these modules execute, they ignore the -T/--timeout value entirely.


Adjusting the Global Timeout for Slow Websites

The global timeout accommodates most use cases without source modification.

Increasing Timeout for Slow Targets

Run Holehe with an extended timeout when targeting sluggish infrastructure:

holehe -T 30 user@example.com

This sets the global request timeout to 30 seconds, applying to all modules without hard-coded overrides.

Decreasing Timeout for Faster Failures

Conversely, reduce the timeout to accelerate failure detection on unstable networks:

holehe -T 5 user@example.com

Overriding Hard-Coded Module Timeouts

When slow websites coincide with modules that enforce short timeouts, you must intervene beyond the CLI.

Option 1: Monkey-Patch Wrapper Script

Create a wrapper that injects your preferred default into all httpx.AsyncClient instances:

#!/usr/bin/env python3
import sys
import httpx
import asyncio
from holehe.core import main as holehe_main

_original_init = httpx.AsyncClient.__init__

def _patched_init(self, *args, **kwargs):
    kwargs.setdefault('timeout', 30)   # enforce your default

    _original_init(self, *args, **kwargs)

httpx.AsyncClient.__init__ = _patched_init

if __name__ == "__main__":
    asyncio.run(holehe_main())

Execute with:

python3 custom_holehe.py user@example.com

This approach captures all requests, overriding even explicit per-call timeout values.

Option 2: Direct Source Modification

For permanent fixes, edit individual modules to remove hard-coded timeouts. In holehe/modules/social_media/myspace.py:

         r = await client.get("https://myspace.com/signup/email",
-                             headers=headers,timeout=2)
+                             headers=headers)   # inherit global timeout

After modification, the module respects your -T/--timeout value.


Key Implementation Files

Understanding these source locations enables precise configuration adjustments:


Summary

  • Global timeout: Controlled via -T/--timeout (default 10s) in holehe/core.py
  • Module overrides: Hard-coded values in specific modules take precedence over global settings
  • CLI adjustment: Use -T 30 for slow websites without modifying code
  • Complete override: Apply monkey-patching or edit source files to eliminate hard-coded timeouts
  • Architecture: httpx.AsyncClient receives the global value; individual requests may specify alternatives

Frequently Asked Questions

How do I check which modules have hard-coded timeouts?

Search the modules directory for explicit timeout= parameters: grep -r "timeout=" holehe/modules/. The analysis identifies MySpace, CaringBridge, OnlineSequencer, and Cracked.to as primary offenders with timeouts between 1–3 seconds.

Will increasing the global timeout affect all requests?

No. Only requests without explicit timeout arguments inherit the global value. Modules like myspace.py and caringbridge.py override this with their own hard-coded limits regardless of your -T setting.

Why does Holehe use hard-coded timeouts in some modules?

Short timeouts prevent individual slow endpoints from stalling entire batch operations. However, this design prioritizes speed over reliability for specific services, creating friction when those services degrade or respond slowly.

Can I set different timeouts for different modules without editing source code?

Not through native CLI options. The architecture provides one global setting. To achieve per-module granularity without source modification, you must implement wrapper logic that inspects the request URL and applies appropriate timeouts dynamically.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →