Commit Graph

198 Commits

Author SHA1 Message Date
lwthiker
fffab4bcc1 Update upstream curl version to 7.84 2022-07-17 16:44:22 +03:00
lwthiker
6903c01688 Update README.md 2022-07-15 11:02:22 +03:00
lwthiker
72f30c958e Add cross compilation support (#85)
Add support for cross-compiling curl-impersonate.

Cross compiling can now be done using the '--host' flag to the configure
script. This will make sure that all sub-components are cross-compiled.
In addition, compiling for a different system requires explicitly
specifying multiple paths used by curl (e.g. for certificates). These
options were added to the configure script as well.

The build and test CI workflow will now attempt to cross-compile
curl-impersonate to ARM64 (aarch64), and upload this binary to the
GitHub release page.

Add the 'configure' script generated by autoconf and its dependencies to
the repository to save the users from having to run 'autoconf' manually.
v0.5.1
2022-07-14 19:50:11 +03:00
lwthiker
6572db81db Update README.md 2022-07-14 10:39:36 +03:00
lwthiker
1253375893 Update README.md 2022-07-14 10:39:08 +03:00
lwthiker
cc1a1c097c Merge pull request #84 from lwthiker/safari_15_5
Add impersonation support for Safari 15.5
2022-07-05 09:05:46 +03:00
lwthiker
c2adb51d08 Remove archive.org from test urls
archive.org rejects connections which makes our test fail.
2022-07-05 08:49:32 +03:00
lwthiker
e5670826ba Add impersonation support for Safari 15.5 2022-07-05 08:22:07 +03:00
lwthiker
d417eb5c5c Rotate URLs in tests script and increase timeout
The tests fail sometimes with timeout for fetching the wikipedia URL.
Try to reduce the chance it happens by increasing the timeout and
rotating URLs.
2022-07-05 08:20:47 +03:00
lwthiker
9d9e393d0e Move curl-impersonate options to separate files
For better organization, move the curl-impersonate impersonation
definitions to a separate impersonate.c and impersonate.h files.
2022-07-05 07:51:37 +03:00
lwthiker
f60fa9ae5a Add sponsors section to README.md 2022-07-04 20:31:25 +03:00
lwthiker
430fe507c3 Merge pull request #83 from lwthiker/firefox_102
Add impersonation support for Firefox 102
2022-07-03 12:25:14 +03:00
lwthiker
440fdd2606 Add impersonation support for Firefox 102 2022-07-03 12:09:55 +03:00
lwthiker
dd88e116d1 Merge pull request #82 from lwthiker/yaml_signatures_reorg
Split signatures YAML database to multiple files
2022-07-03 11:14:05 +03:00
lwthiker
0a007c624e Split signatures YAML database to multiple files
For easier maintenance, split the YAML files with the browser signatures
to multiple files, each per browser.
2022-07-03 10:40:18 +03:00
lwthiker
4e0ca423af Update README.md with up-to-date information 2022-06-23 13:22:46 +03:00
lwthiker
69fce68828 Merge pull request #81 from lwthiker/browsers_json
Store the supported browsers list as a JSON file
2022-06-23 13:17:04 +03:00
lwthiker
1702f0f804 Store the supported browsers list as a JSON file
For easier programmatic access from scripts, etc., store the list of
supported browsers in a browsers.json file. For each browser we store
its details (name, version), which curl-impersonate binary is needed
(chrome vs. firefox) and the name of the wrapper script.
2022-06-23 13:16:15 +03:00
izzues
0b3d593bfd Use portable shebangs in wrapper scripts (#79)
This is the recommended approach and it's necessary on systems like NixOS.

See: https://web.archive.org/web/20220617225709/https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my
2022-06-22 20:37:10 +03:00
lwthiker
fd7bd09bda Update README.md with latest Docker tags 2022-06-03 21:33:08 +03:00
lwthiker
4779505a66 Merge pull request #77 from lwthiker/upload_libcurl_impersonate
Upload precompiled libcurl impersonate on release
v0.5.0
2022-06-03 20:38:57 +03:00
lwthiker
ec2067cb47 Update README.md 2022-06-03 20:38:42 +03:00
lwthiker
58e91b4253 Upload precompiled libcurl impersonate on release
Upload a tar file with libcurl-impersonate compiled for Ubuntu and macOS
automatically for each GitHub release. Previously only a statically
compiled version of the binary curl-impersonate was uploaded.
v0.5.0-alpha.1
2022-06-03 20:09:11 +03:00
lwthiker
d887cc2443 Merge pull request #75 from PeterUpfold/add-unzip-to-chrome-build-docs
Add unzip to dependencies for make chrome-build
2022-06-02 10:20:00 +03:00
Peter Upfold
aebcf85698 Add unzip to dependencies for make chrome-build 2022-06-01 18:19:39 +01:00
lwthiker
4809f03f00 Merge pull request #70 from jwilk-forks/dirname
Use param expansion for extracting directory name
2022-05-30 08:46:25 +03:00
lwthiker
e332bb57d3 Merge pull request #72 from lwthiker/firefox_http2_stream_priority
Set HTTP/2 stream settings correctly
2022-05-30 08:26:13 +03:00
lwthiker
279d9ca7e6 Merge branch 'main' into firefox_http2_stream_priority 2022-05-29 17:52:00 +03:00
lwthiker
612f0c8c9f Merge pull request #73 from lwthiker/fix_broken_clang_build
Fix broken clang build on macOS
2022-05-29 17:51:33 +03:00
lwthiker
662b18d131 Fix broken clang build on macOS
Build on macOS is failing due to unknown compiler options previously
added to support gcc 12 on Fedora. Add "-Wno-unknown-warning-option" to
silence this failure.
2022-05-29 17:29:22 +03:00
lwthiker
6080446ef4 Set HTTP/2 stream settings correctly
HTTP/2 includes various settings pertaining to stream priorities. Chrome
and Firefox handle them differently, and this behavior was not mimicked
in curl-impersonate well. With this commit, the stream settings set
by curl-impersonate are identical to the real browsers.

* With Chrome, the default stream weight is 256 and the "exclusive bit"
is set to ON.
* With Firefox, a complex tree of stream dependencies is created
by default using PRIORITY frames. This behavior is now mimicked by
curl-impersonate.
2022-05-29 16:45:17 +03:00
Jakub Wilk
385d00b211 Use param expansion for extracting directory name 2022-05-23 16:46:29 +02:00
lwthiker
33b63f49e5 Update README.md 2022-05-20 18:10:29 +03:00
lwthiker
75e8bb1f88 Merge pull request #68 from lwthiker/redhat_based
Fix build system to work on Red Hat-based systems
2022-05-20 18:03:48 +03:00
lwthiker
f51620327a Add compiler flags necessary to build on Fedora
* Add compiler flags to the boringssl build step to suppress gcc errors
raised when compiling with gcc 12+, which is present in Fedora. It is not
clear whether this is a compiler bug or a boringssl bug, however the
errors only appear when building in release mode and with gcc 12, so I
don't see any problem with manually supressing them.
* Add documentation for building on Fedora.
2022-05-20 17:46:56 +03:00
lwthiker
41986464c4 Fix build system to work on Red Hat-based systems
Tweak the curl-impersonate build system to make it work on Red Hat
based systems such as CentOS, Fedora and Amazon Linux.

* Change the Makefile to be more portable with different bash versions.
* Detect whether cmake is 'cmake' or 'cmake3', and whether ninja is
'ninja' or 'ninja-build'.
* Explicitly tell brotli to put its libraries in 'lib' dir, otherwise it
might put them in 'lib64' where curl doesn't find them.
* Add instructions for building curl-impersonate from source on Red Hat
based systems.
2022-05-20 15:52:30 +03:00
lwthiker
82bca6dab7 Handle curl_easy_reset() calls when impersonating (#44)
curl_easy_reset() may be used by an application to reset the options on
a curl handle. If an app has the CURL_IMPERSONATE env var defined, then
the impersonation options are automatically set in curl_easy_init() but
will be cleared in a call to curl_easy_reset(). The desired behavior is
for the impersonation options to be retained (as they are "transparent"
to the user), which this commit takes care of.

Note that this only has an effect when libcurl-impersonate is loaded and
the CURL_IMPERSONATE env var is set. Otherwise the regular behavior of
resetting all the handle options is retained.

Test that the unique TLS signature of curl-impersonate is preserved
after a call to curl_easy_reset() when libcurl-impersonate is loaded.
For this purpose change the 'minicurl' testing util to support multiple
URLs and launch it with 2 different URLs when testing the TLS signature.
2022-05-18 11:43:46 +03:00
lwthiker
aa6e8a4700 Merge pull request #67 from lwthiker/chrome100_again
Add impersonation support for Chrome 100 and 101, drop support for Chrome 98
2022-05-17 21:11:49 +03:00
lwthiker
14de5bb0db Add impersonation support for Chrome 100 and 101
.. and for Edge 101 as well. The TLS fingerprint is identical to
previous versions. The HTTP headers have the usual differences in the
user agents. One important change though is in the way the HTTP2
SETTINGS frame is formed. Up until Chrome 98, there was an additional
randomly-generated setting in the frame. This seems to have been removed
since. Therefore it was removed from curl-impersonate as well, and
support for Chrome/Edge 98 was deprecated, since supporting both
signatures requires a lot of work.
2022-05-17 20:53:39 +03:00
lwthiker
4642bd78d7 Merge pull request #62 from lwthiker/wrong_host_header
Fix bug causing a wrong 'Host' header
2022-05-16 21:00:01 +03:00
lwthiker
1b46a3fb88 Merge pull request #65 from lwthiker/firefox100
Add support for impersonating Firefox 100
2022-05-15 21:18:05 +03:00
lwthiker
2a03f51297 Fix incorrect link name in README.md 2022-05-15 20:54:03 +03:00
lwthiker
92a5b8c7ab Add support for impersonating Firefox 100
Add support for impersonating Firefox 100. The TLS signature is identical to
previous versions of Firefox.

In addition, upgrade NSS (Firefox's TLS library) to version 3.77 used by
Firefox 100. This is not strictly necessary as the previous version used
works just fine, but it's better keep up with the newest version.
2022-05-15 20:50:45 +03:00
lwthiker
5846364b95 Fix bug causing a wrong 'Host' header
When reusing a curl handle on which the 'Host' header was explicitly
set, the previously-set header was being kept in use for following
requests.

The issue was in curl-impersonate's merging of user-supplied headers
with its own list of browser headers. The call to
Curl_http_merge_headers() which takes care of this had been placed after
the handling of the host header, which caused the previous one to be
used.
2022-05-14 21:09:14 +03:00
lwthiker
3263cd2c52 Merge pull request #61 from lwthiker/release_artifacts
Add compiled binaries to GitHub releases
v0.4.1
2022-05-14 19:12:16 +03:00
lwthiker
7167328e37 Publish stripped binaries to GitHub release assets
To reduce size of built binaries, strip the binaries before publishing
them.
v0.4.1-alpha.3
2022-05-14 18:50:18 +03:00
lwthiker
e042960659 Update README.md about pre-compiled binaries 2022-05-14 18:49:46 +03:00
lwthiker
201a5472ef Add option to strip binaries before installation
And use 'install' instead of 'cp' for installing the wrapper scripts.
2022-05-14 18:48:28 +03:00
lwthiker
b0e9d4c91e Use 'rm -f' in Makefile.in
Use 'rm -f' to ignore non-existant file errors.
v0.4.1-alpha.2
2022-05-14 17:58:22 +03:00
lwthiker
53a87e0d9d Add forgotten '.PHONY' declarations in Makefile.in v0.4.1-alpha.1 2022-05-14 10:10:34 +03:00