PitchHut logo
httpmorph
A high-performance HTTP client mimicking browser fingerprints.
Pitch

httpmorph serves as a drop-in replacement for Python's requests library, utilizing a custom C implementation with BoringSSL for enhanced performance. It boasts features such as HTTP/2 support, realistic browser fingerprinting, and connection pooling, making it ideal for developers seeking to mimic browser interactions seamlessly.

Description

httpmorph is an innovative Python HTTP client designed to replicate browser fingerprints effectively. It serves as a drop-in replacement for Python's popular requests library while leveraging a custom C implementation alongside BoringSSL to enhance performance and security.

Key Features

  • Requests-compatible API: Seamlessly integrate with existing applications that use Python's requests.
  • High Performance: Achieves superior speed through its native C implementation, focused on optimizing HTTP/HTTPS requests.
  • HTTP/2 Support: Fully supports HTTP/2, employing ALPN negotiation via nghttp2, providing an httpx-like API experience.
  • Realistic Browser Fingerprinting: Mimics the Chrome 142 browser profile utilizing JA3N, JA4, and JA4_R fingerprinting for enhanced identification accuracy.
  • TLS Fingerprinting: Generates matching JA3/JA3N/JA4 fingerprints with support for post-quantum cryptography.
  • Connection Pooling: Ensures efficient resource management through automatic connection reuse.
  • Session Management: Maintains persistent cookies and headers for subsequent requests, enhancing usability.

Quick Usage

Using httpmorph is straightforward. Here’s a brief example demonstrating some of its capabilities:

import httpmorph

# Simple GET request
response = httpmorph.get('https://icanhazip.com')
print(response.status_code)
print(response.text)

# Sending a POST request with JSON data
response = httpmorph.post(
    'https://httpbin.org/post',
    json={'key': 'value'}
)

# Working with browser sessions
session = httpmorph.Session(browser='chrome')
response = session.get('https://example.com')

# Leveraging HTTP/2 support
client = httpmorph.Client(http2=True)
response = client.get('https://www.google.com')
print(response.http_version)  # Should display '2.0'

Advanced Capabilities

httpmorph also supports advanced features such as:

  • Custom headers for requests, file uploads, and timeout control.
  • Simulating requests from different operating systems by specifying user agents tailored to various platforms.
  • Detailed response handling, including access to headers, timing information, and comprehensive error handling with exceptions.

Compatibility and Support

httpmorph is built for compatibility with multiple platforms including Windows, macOS, and Linux, using BoringSSL for consistent TLS behaviors. With comprehensive testing and ongoing development, the library aims to be production-ready in the future while currently providing a robust and flexible HTTP client for developers needing speed and realistic browser interaction.

Explore the repository for detailed API documentation and contribution guidelines.

0 comments

No comments yet.

Sign in to be the first to comment.