{"id":42797715,"url":"https://github.com/arman-bd/httpmorph","last_synced_at":"2026-03-11T04:02:59.032Z","repository":{"id":318730071,"uuid":"1071833859","full_name":"arman-bd/httpmorph","owner":"arman-bd","description":"httpmorph is a drop-in replacement for Python's requests library that uses a custom C implementation with BoringSSL instead of Python's standard HTTP stack.","archived":false,"fork":false,"pushed_at":"2025-12-15T20:10:32.000Z","size":6998,"stargazers_count":128,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T18:46:16.994Z","etag":null,"topics":["antifingerprint","bot-mitigation-bypass","browserfingerprint","chrome-impersonate","fingerprinting","http-client","http2-client","http2-fingerprint","httplibrary","ja3","ja3-fingerprint","ja4","ja4-fingerprint","tls-fingerprint","web-scraping","web-scraping-python"],"latest_commit_sha":null,"homepage":"https://httpmorph.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arman-bd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-07T21:58:12.000Z","updated_at":"2026-01-28T14:50:54.000Z","dependencies_parsed_at":"2025-10-13T13:43:41.207Z","dependency_job_id":"4aede747-5592-4a2d-8cfe-0a12c35d39e0","html_url":"https://github.com/arman-bd/httpmorph","commit_stats":null,"previous_names":["arman-bd/httpmorph"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/arman-bd/httpmorph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arman-bd%2Fhttpmorph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arman-bd%2Fhttpmorph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arman-bd%2Fhttpmorph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arman-bd%2Fhttpmorph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arman-bd","download_url":"https://codeload.github.com/arman-bd/httpmorph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arman-bd%2Fhttpmorph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antifingerprint","bot-mitigation-bypass","browserfingerprint","chrome-impersonate","fingerprinting","http-client","http2-client","http2-fingerprint","httplibrary","ja3","ja3-fingerprint","ja4","ja4-fingerprint","tls-fingerprint","web-scraping","web-scraping-python"],"created_at":"2026-01-30T02:00:22.783Z","updated_at":"2026-03-11T04:02:59.026Z","avatar_url":"https://github.com/arman-bd.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# httpmorph\n\n![Build](https://github.com/arman-bd/httpmorph/workflows/CI/badge.svg) [![codecov](https://codecov.io/gh/arman-bd/httpmorph/graph/badge.svg?token=D7BCC52PQN)](https://codecov.io/gh/arman-bd/httpmorph) [![PyPI version](https://badge.fury.io/py/httpmorph.svg)](https://pypi.org/project/httpmorph/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue) ![Platforms](https://img.shields.io/badge/platforms-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey) ![Architectures](https://img.shields.io/badge/arch-x86__64%20%7C%20aarch64%20%7C%20arm64-green)\n\nA Python HTTP client focused on mimicking browser fingerprints.\n\n**⚠️ Work in Progress** - This library is in early development. Features and API may change.\n\n## Features\n\n- **Requests-compatible API** - Drop-in replacement for most Python `requests` use cases\n- **High Performance** - Native C implementation with BoringSSL for HTTP/HTTPS\n- **HTTP/2 Support** - Full HTTP/2 with ALPN negotiation via nghttp2 (httpx-like API)\n- **Chrome 127-143 Fingerprints** - Perfect JA4 fingerprint matching\n- **Browser Fingerprinting** - Realistic Chrome browser profiles (127-143)\n- **TLS Fingerprinting** - JA3N/JA4/JA4_R fingerprint generation with post-quantum crypto\n- **HTTP/2 Fingerprinting** - Perfect Akamai HTTP/2 fingerprint matching\n- **Connection Pooling** - Automatic connection reuse for better performance\n- **Session Management** - Persistent cookies and headers across requests\n\n## Installation\n\n```bash\npip install httpmorph\n```\n\n### Platform Support\n\nhttpmorph provides pre-built wheels for maximum compatibility:\n\n| Platform | Architectures | Python Versions |\n|----------|--------------|-----------------|\n| **Linux** | x86_64, aarch64 (ARM64) | 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 |\n| **macOS** | Intel (x86_64), Apple Silicon (arm64)* | 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 |\n| **Windows** | x64 (AMD64) | 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 |\n\n_*macOS wheels are universal2 binaries supporting both Intel and Apple Silicon_\n\n**Total Coverage: 28 pre-built wheels serving 99%+ of Python users**\n\n#### Requirements\n- Python 3.8 or later\n- No compilation required - batteries included!\n\n## Quick Start\n\n```python\nimport httpmorph\n\n# Simple GET request\nresponse = httpmorph.get('https://icanhazip.com')\nprint(response.status_code)\nprint(response.text)\n\n# POST with JSON\nresponse = httpmorph.post(\n    'https://httpbin.org/post',\n    json={'key': 'value'}\n)\n\n# Using sessions\nsession = httpmorph.Session(browser='chrome')\nresponse = session.get('https://example.com')\n\n# HTTP/2 support (httpx-like API)\nclient = httpmorph.Client(http2=True)\nresponse = client.get('https://www.google.com')\nprint(response.http_version)  # '2.0'\n```\n\n## Browser Profiles\n\nMimic real browser behavior with pre-configured profiles:\n\n```python\n# Use Chrome fingerprint (defaults to Chrome 143)\nresponse = httpmorph.get('https://example.com', browser='chrome')\n\n# Use specific Chrome version (127-143 supported)\nsession = httpmorph.Session(browser='chrome143')\nresponse = session.get('https://example.com')\n\n# Available browsers: chrome, chrome127-chrome143\n```\n\n### OS-Specific User Agents\n\nhttpmorph supports different operating system user agents to simulate requests from various platforms:\n\n```python\nimport httpmorph\n\n# macOS (default)\nsession = httpmorph.Session(browser='chrome', os='macos')\n# User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\n\n# Windows\nsession = httpmorph.Session(browser='chrome', os='windows')\n# User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...\n\n# Linux\nsession = httpmorph.Session(browser='chrome', os='linux')\n# User-Agent: Mozilla/5.0 (X11; Linux x86_64) ...\n```\n\n**Supported OS values:**\n- `macos` - macOS / Mac OS X (default)\n- `windows` - Windows 10/11\n- `linux` - Linux distributions\n\nThe OS parameter only affects the User-Agent string, while all other fingerprinting characteristics (TLS, HTTP/2, JA3/JA4) remain consistent to match the specified browser profile.\n\n### Chrome Fingerprint Matching\n\nhttpmorph accurately mimics **Chrome 127-143** TLS and HTTP/2 fingerprints with:\n\n- **JA4** ✅ Perfect match (`t13d1516h2_8daaf6152771_d8a2da3f94cd`)\n- **JA4_R** ✅ Perfect match\n- **JA3N** ✅ Perfect match (normalized JA3: `dcefaf3f0e71d260d19dc1d0749c9278`)\n- **HTTP/2 Akamai** ✅ Perfect match (`1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p`)\n- **User-Agent**: Version-specific Chrome user agents\n- **TLS 1.3** with correct cipher suites and extensions\n- **HTTP/2** with Chrome-specific SETTINGS frame and pseudo-header order\n- **Post-quantum cryptography** (X25519MLKEM768)\n- **Certificate compression** (Brotli)\n\n**Verify your fingerprint:**\n\n```python\nimport httpmorph\n\n# Make a request to fingerprint checker\nresponse = httpmorph.get('https://tls.peet.ws/api/all', browser='chrome143')\ndata = response.json()\nprint(f\"JA4: {data['tls']['ja4']}\")\n\n# Expected: t13d1516h2_8daaf6152771_d8a2da3f94cd ✅\n```\n\nAll Chrome 127-143 profiles produce **exact JA4 matches** with real Chrome browsers.\n\n## Advanced Usage\n\n### HTTP/2 Support\n\nhttpmorph supports HTTP/2 with an httpx-like API:\n\n```python\n# Both Client and Session default to HTTP/2 (http2=True) like Chrome\nclient = httpmorph.Client()\nresponse = client.get('https://www.google.com')\nprint(response.http_version)  # '2.0'\n\nsession = httpmorph.Session(browser='chrome')\nresponse = session.get('https://www.google.com')\nprint(response.http_version)  # '2.0'\n\n# Per-request HTTP/2 override (disable for specific request)\nclient = httpmorph.Client()  # Defaults to HTTP/2\nresponse = client.get('https://example.com', http2=False)  # Disable for this request\n```\n\n### Custom Headers\n\n```python\nheaders = {\n    'User-Agent': 'MyApp/1.0',\n    'Authorization': 'Bearer token123'\n}\nresponse = httpmorph.get('https://api.example.com', headers=headers)\n```\n\n### File Uploads\n\n```python\nfiles = {'file': ('report.pdf', open('report.pdf', 'rb'))}\nresponse = httpmorph.post('https://httpbin.org/post', files=files)\n```\n\n### Timeout Control\n\n```python\n# Single timeout value\nresponse = httpmorph.get('https://example.com', timeout=5)\n\n# Separate connect and read timeouts\nresponse = httpmorph.get('https://example.com', timeout=(3, 10))\n```\n\n### SSL Verification\n\n```python\n# Disable SSL verification (not recommended for production)\nresponse = httpmorph.get('https://example.com', verify_ssl=False)\n```\n\n### Authentication\n\n```python\n# Basic authentication\nresponse = httpmorph.get(\n    'https://api.example.com',\n    auth=('username', 'password')\n)\n```\n\n### Redirects\n\n```python\n# Follow redirects (default behavior)\nresponse = httpmorph.get('https://example.com/redirect')\n\n# Don't follow redirects\nresponse = httpmorph.get(\n    'https://example.com/redirect',\n    allow_redirects=False\n)\n\n# Check redirect history\nprint(len(response.history))  # Number of redirects\n```\n\n### Sessions with Cookies\n\n```python\nsession = httpmorph.Session()\n\n# Cookies persist across requests\nsession.get('https://example.com/login')\nsession.post('https://example.com/form', data={'key': 'value'})\n\n# Access cookies\nprint(session.cookies)\n```\n\n## API Compatibility\n\nhttpmorph aims for high compatibility with Python's `requests` library:\n\n| Feature | Status |\n|---------|--------|\n| GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS | Supported |\n| JSON request/response | Supported |\n| Form data \u0026 file uploads | Supported |\n| Custom headers | Supported |\n| Authentication | Supported |\n| Cookies \u0026 sessions | Supported |\n| Redirects with history | Supported |\n| Timeout control | Supported |\n| SSL verification | Supported |\n| Streaming responses | Supported |\n| Exception hierarchy | Supported |\n\n## Response Object\n\n```python\nresponse = httpmorph.get('https://httpbin.org/get')\n\n# Status and headers\nprint(response.status_code)      # 200\nprint(response.ok)                # True\nprint(response.reason)            # 'OK'\nprint(response.headers)           # {'Content-Type': 'application/json', ...}\n\n# Response body\nprint(response.text)              # Response as string\nprint(response.body)              # Response as bytes\nprint(response.json())            # Parse JSON response\n\n# Request info\nprint(response.url)               # Final URL after redirects\nprint(response.history)           # List of redirect responses\n\n# Timing\nprint(response.elapsed)           # Response time\nprint(response.total_time_us)     # Total time in microseconds\n\n# TLS info\nprint(response.tls_version)       # TLS version used\nprint(response.tls_cipher)        # Cipher suite\nprint(response.ja3_fingerprint)   # JA3 fingerprint\n```\n\n## Exception Handling\n\n```python\nimport httpmorph\n\ntry:\n    response = httpmorph.get('https://example.com', timeout=5)\n    response.raise_for_status()  # Raise exception for 4xx/5xx\nexcept httpmorph.Timeout:\n    print(\"Request timed out\")\nexcept httpmorph.ConnectionError:\n    print(\"Failed to connect\")\nexcept httpmorph.HTTPError as e:\n    print(f\"HTTP error: {e.response.status_code}\")\nexcept httpmorph.RequestException as e:\n    print(f\"Request failed: {e}\")\n```\n\n## Platform Support\n\n| Platform | Status |\n|----------|--------|\n| Windows | ✅ Fully supported |\n| macOS (Intel \u0026 Apple Silicon) | ✅ Fully supported |\n| Linux (x86_64, ARM64) | ✅ Fully supported |\n\nAll platforms use **BoringSSL** (Google's fork of OpenSSL) for consistent TLS behavior and advanced fingerprinting capabilities.\n\n## Building from Source\n\nhttpmorph uses **BoringSSL** (built from source) on all platforms for consistent TLS fingerprinting.\n\n### Prerequisites\n\n**Windows:**\n```bash\n# Install build tools\nchoco install cmake golang nasm visualstudio2022buildtools -y\n\n# Or install manually:\n# - Visual Studio 2019+ (with C++ tools)\n# - CMake 3.15+\n# - Go 1.18+\n# - NASM (for BoringSSL assembly optimizations)\n```\n\n**macOS:**\n```bash\n# Install dependencies\nbrew install cmake ninja libnghttp2\n```\n\n**Linux:**\n```bash\n# Ubuntu/Debian\nsudo apt-get install cmake ninja-build libssl-dev pkg-config autoconf automake libtool\n\n# Fedora/RHEL\nsudo dnf install cmake ninja-build openssl-devel pkg-config autoconf automake libtool\n```\n\n### Build Steps\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/arman-bd/httpmorph.git\ncd httpmorph\n\n# 2. Build vendor dependencies (BoringSSL, nghttp2, zlib)\n./scripts/setup_vendors.sh  # On Windows: bash scripts/setup_vendors.sh\n\n# 3. Build Python extensions\npython setup.py build_ext --inplace\n\n# 4. Install in development mode\npip install -e \".[dev]\"\n```\n\n**Note:** The first build takes 5-10 minutes as it compiles BoringSSL from source. Subsequent builds are much faster (~30 seconds) as the vendor libraries are cached.\n\n## Development\n\n```bash\n# Clone and setup (includes building BoringSSL)\ngit clone https://github.com/arman-bd/httpmorph.git\ncd httpmorph\n./scripts/setup_vendors.sh\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Run tests\npytest tests/ -v\n\n# Run with coverage\npytest tests/ --cov=httpmorph --cov-report=html\n\n# Run specific test markers\npytest tests/ -m \"not slow\"           # Skip slow tests\npytest tests/ -m \"not proxy\"          # Skip proxy tests (default in CI)\npytest tests/ -m proxy                # Only proxy tests\npytest tests/ -m integration          # Only integration tests\npytest tests/ -m fingerprint          # Only fingerprinting tests\n```\n\n## Architecture\n\nhttpmorph combines the best of both worlds:\n\n- **C Core**: Low-level HTTP/TLS implementation for maximum performance\n- **Python Wrapper**: Clean, Pythonic API with requests compatibility\n- **BoringSSL**: Google's fork of OpenSSL, optimized and battle-tested\n- **nghttp2**: Standard-compliant HTTP/2 implementation\n\nThe library uses Cython to bridge Python and C, providing near-native performance with the ease of Python.\n\n## Contributing\n\nContributions are welcome! Areas where help is especially appreciated:\n\n- Windows compatibility\n- Additional browser profiles\n- Performance optimizations\n- Documentation improvements\n- Bug reports and fixes\n\nPlease open an issue or pull request on GitHub.\n\n## Testing\n\nhttpmorph has a comprehensive test suite with 350+ tests covering:\n\n- All HTTP methods and parameters\n- Chrome 127-143 fingerprint validation (JA4, JA4_R)\n- TLS 1.2/1.3 with post-quantum cryptography\n- Certificate compression (Brotli, Zlib)\n- Redirect handling and history\n- Cookie and session management\n- Authentication and SSL\n- Error handling and timeouts\n- Unicode and encoding edge cases\n- Thread safety and memory management\n- Real-world integration tests\n\nRun the test suite:\n\n```bash\npytest tests/ -v\n```\n\n## Acknowledgments\n\n- Built on BoringSSL (Google) with post-quantum cryptography support\n- HTTP/2 support via nghttp2\n- Inspired by Python's requests and httpx libraries\n- Chrome 127-143 fingerprint matching with perfect JA4, JA3N, and HTTP/2 Akamai fingerprints\n- Certificate compression (Brotli) for Cloudflare-protected sites\n\n## FAQ\n\n**Q: Why another HTTP client?**\nA: httpmorph combines the performance of native C with browser fingerprinting capabilities, making it ideal for applications that need both speed and realistic browser behavior.\n\n**Q: How accurate are the Chrome fingerprints?**\nA: httpmorph achieves perfect JA4 matches for Chrome 127-143. Test your fingerprint at https://tls.peet.ws/api/all\n\n**Q: Is it production-ready?**\nA: No, httpmorph is still in active development and not yet recommended for production use.\n\n**Q: Can I use this as a drop-in replacement for requests?**\nA: For most common use cases, yes! We've implemented the most widely-used requests API. Some advanced features may have slight differences.\n\n**Q: Does it work with Cloudflare-protected sites?**\nA: Yes! httpmorph supports certificate compression (Brotli) which is required for many Cloudflare-protected sites. We successfully tested with icanhazip.com and postman-echo.com.\n\n**Q: How do I report a bug?**\nA: Please open an issue on GitHub with a minimal reproduction example and your environment details (OS, Python version, httpmorph version).\n\n## Support\n\n- GitHub Issues: [Report bugs and feature requests](https://github.com/arman-bd/httpmorph/issues)\n- Documentation: [Full API documentation](https://httpmorph.readthedocs.io)\n- PyPI: [httpmorph on PyPI](https://pypi.org/project/httpmorph/)\n\n## License\n\nMIT License - See [LICENSE](LICENSE) file for details.\n\n## Legal Disclaimer\n\n**FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY**\n\nThis software is provided for educational, research, authorized security testing, and development purposes only.\n\n**No Affiliation:** This software is not affiliated with, endorsed by, or connected to Google, Chrome, or any browser vendors. All trademarks are property of their respective owners.\n\n**User Responsibility:** You are solely responsible for your use of this software and any consequences. You must:\n- Obtain proper authorization before testing systems you don't own\n- Comply with all applicable laws, regulations, and terms of service\n- Respect robots.txt and website usage policies\n- NOT use this for illegal, unauthorized, or malicious activities\n\n**Prohibited Uses:** Do not use this software for bypassing security measures without authorization, violating terms of service, unauthorized access, unauthorized web scraping, circumventing rate limits, fraud, harassment, or any illegal activities.\n\n**Disclaimer:** The authors disclaim all liability for any damages arising from use or misuse of this software. This software is provided \"AS IS\" without warranties of any kind. Use at your own risk.\n\n**Agreement:** By using this software, you agree to these terms. If you disagree, do not use this software.\n\n---\n\n*Use this tool ethically and legally. You assume all risks and responsibilities.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farman-bd%2Fhttpmorph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farman-bd%2Fhttpmorph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farman-bd%2Fhttpmorph/lists"}