Skip to content

Commit 598d439

Browse files
authored
Release v0.2.4 (#28)
* [CHORE] support chrome 142 and fix windows build (#27) * feat: Add Chrome 142 fingerprint support with certificate compression - Enable certificate compression (Brotli, Zlib) for Cloudflare compatibility - Implement perfect JA3N, JA4, and JA4_R fingerprint matching - Add chrome/chrome142 browser profile aliases - Include comprehensive Chrome 142 fingerprint tests - Update README with Chrome 142 features and legal disclaimer - Re-enable MLKEM768 post-quantum cryptography support * chore: ignore Cython-generated .cpp files * perf(windows): add parallel compilation and cache detection to vendor builds * fix(windows): detect MSVC environment before using Ninja generator Ninja generator requires MSVC compiler (cl) to be in PATH, but in CI environments without Visual Studio Developer Command Prompt active, cl is not available. This caused cmake configuration to fail. Fix: Check for both ninja AND cl before using Ninja generator. Falls back to Visual Studio generator which automatically sets up MSVC environment. This maintains parallel compilation benefits via --parallel flag while ensuring builds work in all CI environments. * feat: add OS-specific user agent support (macOS, Windows, Linux) Add support for OS-specific user agents across all browser profiles. Users can now specify the operating system to simulate different platforms. Changes: - Add os_type_t enum (OS_MACOS, OS_WINDOWS, OS_LINUX) in browser_profiles.h - Add user_agent_windows and user_agent_linux fields to browser_profile_t - Add browser_profile_get_user_agent() helper function - Update PROFILE_CHROME_142 with OS-specific user agents: * macOS: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ... * Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... * Linux: Mozilla/5.0 (X11; Linux x86_64) ... - Add 'os' parameter to Session class (default: 'macos') - Update Python client to pass OS parameter through to C extension Usage: session = httpmorph.Session(browser='chrome', os='windows') session = httpmorph.Session(browser='chrome', os='linux') session = httpmorph.Session(browser='chrome') # defaults to macOS Supported OS values: 'macos' (default), 'windows', 'linux' * test: add OS-specific user agent tests for macOS, Windows, and Linux Add 3 test cases to verify OS-specific user agents using httpbin /user-agent: - test_os_macos_user_agent: Verifies macOS user agent string - test_os_windows_user_agent: Verifies Windows user agent string - test_os_linux_user_agent: Verifies Linux user agent string Each test: - Creates session with specific OS parameter - Makes request to httpbin /user-agent endpoint - Validates correct OS-specific user agent is sent All tests pass successfully. * docs: Add OS-specific user agents and clean up documentation - Add os parameter to Session (macos, windows, linux) - Update README.md and readthedocs with OS feature - Remove obsolete browser profiles (firefox, safari, edge) - Add accurate Chrome 142 fingerprint documentation - Update API reference with correct parameters * feat: benchmark on windows * feat: benchmark on mac
1 parent 1511ebf commit 598d439

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+9429
-8882
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pip-delete-this-directory.txt
1515

1616
# Cython generated files (only in bindings directory)
1717
src/bindings/*.c
18+
src/bindings/*.cpp
1819
src/bindings/*.html
19-
_httpmorph.cpp
2020

2121
# C/C++
2222
*.o

README.md

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ A Python HTTP client focused on mimicking browser fingerprints.
1111
- **Requests-compatible API** - Drop-in replacement for most Python `requests` use cases
1212
- **High Performance** - Native C implementation with BoringSSL for HTTP/HTTPS
1313
- **HTTP/2 Support** - Full HTTP/2 with ALPN negotiation via nghttp2 (httpx-like API)
14-
- **Browser Fingerprinting** - Realistic browser profiles (Chrome and it's variants)
15-
- **TLS Fingerprinting** - JA3 fingerprint generation and customization
14+
- **Chrome 142 Fingerprint** - Perfect JA3N, JA4, and JA4_R matching
15+
- **Browser Fingerprinting** - Realistic Chrome 142 browser profile
16+
- **TLS Fingerprinting** - JA3/JA3N/JA4 fingerprint generation with post-quantum crypto
1617
- **Connection Pooling** - Automatic connection reuse for better performance
1718
- **Session Management** - Persistent cookies and headers across requests
1819

@@ -60,16 +61,73 @@ print(response.http_version) # '2.0'
6061
Mimic real browser behavior with pre-configured profiles:
6162

6263
```python
63-
# Use Chrome fingerprint
64+
# Use Chrome fingerprint (defaults to Chrome 142)
6465
response = httpmorph.get('https://example.com', browser='chrome')
6566

66-
# Use Firefox fingerprint
67-
session = httpmorph.Session(browser='firefox')
67+
# Use specific Chrome version
68+
session = httpmorph.Session(browser='chrome142')
6869
response = session.get('https://example.com')
6970

70-
# Available browsers: chrome, firefox, safari, edge
71+
# Available browsers: chrome, chrome142
7172
```
7273

74+
### OS-Specific User Agents
75+
76+
httpmorph supports different operating system user agents to simulate requests from various platforms:
77+
78+
```python
79+
import httpmorph
80+
81+
# macOS (default)
82+
session = httpmorph.Session(browser='chrome', os='macos')
83+
# User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...
84+
85+
# Windows
86+
session = httpmorph.Session(browser='chrome', os='windows')
87+
# User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
88+
89+
# Linux
90+
session = httpmorph.Session(browser='chrome', os='linux')
91+
# User-Agent: Mozilla/5.0 (X11; Linux x86_64) ...
92+
```
93+
94+
**Supported OS values:**
95+
- `macos` - macOS / Mac OS X (default)
96+
- `windows` - Windows 10/11
97+
- `linux` - Linux distributions
98+
99+
The 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.
100+
101+
### Chrome 142 Fingerprint Matching
102+
103+
httpmorph accurately mimics **Chrome 142** TLS fingerprints with:
104+
105+
- **JA3N** ✅ Perfect match
106+
- **JA4** ✅ Perfect match
107+
- **JA4_R** ✅ Perfect match
108+
- **User-Agent**: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36`
109+
- **TLS 1.3** with correct cipher suites and extensions
110+
- **HTTP/2** with Chrome-specific SETTINGS frame
111+
- **Post-quantum cryptography** (X25519MLKEM768)
112+
- **Certificate compression** (Brotli, Zlib)
113+
114+
**Verify your fingerprint:**
115+
116+
```python
117+
import httpmorph
118+
119+
# Make a request to fingerprint checker
120+
response = httpmorph.get('https://suip.biz/?act=ja4', browser='chrome142')
121+
print(response.text)
122+
123+
# You should see perfect matches for:
124+
# - JA4 fingerprint ✅
125+
# - JA3N fingerprint ✅
126+
# - User-Agent: Chrome/142.0.0.0 ✅
127+
```
128+
129+
httpmorph achieves **perfect matches** for all modern fingerprints including JA3N, JA4, and JA4_R when tested against real Chrome 142 browsers.
130+
73131
## Advanced Usage
74132

75133
### HTTP/2 Support
@@ -343,9 +401,12 @@ Please open an issue or pull request on GitHub.
343401

344402
## Testing
345403

346-
httpmorph has a comprehensive test suite with 270+ tests covering:
404+
httpmorph has a comprehensive test suite with 350+ tests covering:
347405

348406
- All HTTP methods and parameters
407+
- Chrome 142 fingerprint validation (JA3N, JA4, JA4_R)
408+
- TLS 1.2/1.3 with post-quantum cryptography
409+
- Certificate compression (Brotli, Zlib)
349410
- Redirect handling and history
350411
- Cookie and session management
351412
- Authentication and SSL
@@ -362,22 +423,29 @@ pytest tests/ -v
362423

363424
## Acknowledgments
364425

365-
- Built on BoringSSL (Google)
426+
- Built on BoringSSL (Google) with post-quantum cryptography support
366427
- HTTP/2 support via nghttp2
367428
- Inspired by Python's requests and httpx libraries
368-
- Browser fingerprints based on real browser implementations ( still in progress )
429+
- Chrome 142 fingerprint matching with perfect JA3N, JA4, and JA4_R matches
430+
- Certificate compression support for Cloudflare-protected sites
369431

370432
## FAQ
371433

372434
**Q: Why another HTTP client?**
373435
A: httpmorph combines the performance of native C with browser fingerprinting capabilities, making it ideal for applications that need both speed and realistic browser behavior.
374436

437+
**Q: How accurate is the Chrome 142 fingerprint?**
438+
A: httpmorph achieves perfect matches for modern fingerprints including JA3N, JA4, and JA4_R. This is verified against real Chrome 142 browsers. Test your fingerprint at https://suip.biz/?act=ja4
439+
375440
**Q: Is it production-ready?**
376441
A: No, httpmorph is still in active development and not yet recommended for production use.
377442

378443
**Q: Can I use this as a drop-in replacement for requests?**
379444
A: For most common use cases, yes! We've implemented the most widely-used requests API. Some advanced features may have slight differences.
380445

446+
**Q: Does it work with Cloudflare-protected sites?**
447+
A: Yes! httpmorph supports certificate compression (Brotli, Zlib) which is required for many Cloudflare-protected sites. We successfully tested with icanhazip.com and postman-echo.com.
448+
381449
**Q: How do I report a bug?**
382450
A: Please open an issue on GitHub with a minimal reproduction example and your environment details (OS, Python version, httpmorph version).
383451

@@ -387,6 +455,30 @@ A: Please open an issue on GitHub with a minimal reproduction example and your e
387455
- Documentation: [Full API documentation](https://httpmorph.readthedocs.io)
388456
- PyPI: [httpmorph on PyPI](https://pypi.org/project/httpmorph/)
389457

458+
## License
459+
460+
MIT License - See [LICENSE](LICENSE) file for details.
461+
462+
## Legal Disclaimer
463+
464+
**FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY**
465+
466+
This software is provided for educational, research, authorized security testing, and development purposes only.
467+
468+
**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.
469+
470+
**User Responsibility:** You are solely responsible for your use of this software and any consequences. You must:
471+
- Obtain proper authorization before testing systems you don't own
472+
- Comply with all applicable laws, regulations, and terms of service
473+
- Respect robots.txt and website usage policies
474+
- NOT use this for illegal, unauthorized, or malicious activities
475+
476+
**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.
477+
478+
**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.
479+
480+
**Agreement:** By using this software, you agree to these terms. If you disagree, do not use this software.
481+
390482
---
391483

392-
**httpmorph** - Fast, compatible, and powerful HTTP for Python.
484+
*Use this tool ethically and legally. You assume all risks and responsibilities.*

0 commit comments

Comments
 (0)