What Is the Default HTTP Timeout for Holehe?
The default HTTP timeout for Holehe is 10 seconds, hardcoded in the command-line interface argument parser and applied to every httpx.AsyncClient instance used for email verification requests.
Holehe, an asynchronous email OSINT tool available in the megadose/holehe repository, relies on rapid HTTP requests across hundreds of platforms. The default HTTP timeout for Holehe ensures that slow or unresponsive services do not hang the entire scanning process, balancing thoroughness with execution speed.
Where the Default Timeout Is Defined in holehe/core.py
The 10-second default originates in the CLI argument parsing logic. In holehe/core.py, the --timeout (or -T) argument is configured with an explicit default value:
# Representation of holehe/core.py lines 194-195
parser.add_argument("-T", "--timeout", default=10, type=int,
help="Timeout in seconds for each HTTP request")
When a user executes Holehe without specifying a timeout flag, this default=10 value is captured and passed through the application logic. The argument parser ensures that the timeout is always an integer representing seconds, providing a fail-safe mechanism if the parameter is omitted.
How the Timeout Is Applied to httpx.AsyncClient
After parsing, the timeout value propagates to the HTTP client instantiation. According to the source code in holehe/core.py around line 213, the tool constructs an httpx.AsyncClient using the parsed timeout:
import httpx
# timeout variable holds the value from CLI (default 10)
client = httpx.AsyncClient(timeout=timeout)
This initialization ensures that every asynchronous HTTP request made during the email verification process adheres to the 10-second limit. If a target website fails to respond within this window, httpx raises a TimeoutException, allowing Holehe to abandon that specific check and proceed to the next platform rather than waiting indefinitely.
Changing the Default Timeout Value
Researchers working with unreliable network conditions or specifically slow targets may need to adjust this behavior. Holehe provides a straightforward mechanism to override the default without modifying source code.
Using the Command Line Flag
To specify a custom timeout, use the -T or --timeout flag followed by the desired duration in seconds:
# Run with the default 10-second timeout
holehe -u target@example.com
# Reduce timeout to 5 seconds for faster failure on slow networks
holehe -u target@example.com -T 5
# Increase timeout to 30 seconds for high-latency targets
holehe -u target@example.com --timeout 30
Programmatic Configuration
When importing Holehe as a library within Python scripts, you can instantiate the HTTP client with custom parameters. While the primary CLI interface handles the default, understanding the underlying httpx implementation allows for advanced customization:
import httpx
import asyncio
async def custom_holehe_check(email, timeout_seconds=15):
# Override the default 10s with a custom value
async with httpx.AsyncClient(timeout=timeout_seconds) as client:
# Custom implementation logic here
response = await client.get("https://example.com/api/check",
params={"email": email})
return response.status_code == 200
Summary
- Holehe sets a 10-second default HTTP timeout to prevent hanging on unresponsive services.
- The default is defined in
holehe/core.pywithin the CLI argument parser (default=10). - The value is passed directly to
httpx.AsyncClient(timeout=timeout)at line 213 of the core module. - Users can override the default using the
-Tor--timeoutcommand line flag. - All asynchronous HTTP requests in the tool respect this single timeout configuration.
Frequently Asked Questions
What is the default HTTP timeout for Holehe?
The default HTTP timeout for Holehe is 10 seconds. This value is hardcoded in the argument parser in holehe/core.py and applies to all HTTP requests made by the tool's httpx.AsyncClient unless explicitly overridden by the user.
How do I change the timeout value in Holehe?
You can change the timeout using the -T or --timeout flag followed by the number of seconds. For example, holehe -u email@example.com -T 5 sets the timeout to 5 seconds. This value is then passed to the httpx.AsyncClient constructor, replacing the default 10-second setting.
Which HTTP client library does Holehe use?
Holehe uses httpx.AsyncClient for all asynchronous HTTP operations. This modern Python library supports HTTP/2 and provides robust timeout handling, which Holehe leverages by passing the parsed CLI timeout value directly to the client constructor in holehe/core.py.
Does Holehe support different timeouts for different modules?
No, Holehe uses a global timeout setting that applies to all verification modules equally. The single --timeout flag configures the httpx.AsyncClient instance used across the entire scan, meaning all websites checked during a single execution share the same timeout threshold.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →