Skip to content

fix: porting to curl-impersonate v1.0.0 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- '**'
workflow_dispatch:

env:
PRIMARY_NODE_VERSION: 20
Expand Down
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
'libraries': [
'-L<(build_dir)/lib',
'<!@(<(build_dir)/bin/curl-impersonate-chrome-config --static-libs)',
'<!@(<(build_dir)/bin/curl-impersonate-config --static-libs)',
]
}],
['OS=="mac"', {
Expand All @@ -46,11 +46,11 @@
# This seems to be required starting with xcode 12
# original workaround from https://github.com/JCMais/node-libcurl/pull/312
'-static',
'<!@(<(build_dir)/bin/curl-impersonate-chrome-config --static-libs | sed "s/-framework CoreFoundation//")',
'<!@(<(build_dir)/bin/curl-impersonate-config --static-libs | sed "s/-framework CoreFoundation//")',
],

'LD_RUNPATH_SEARCH_PATHS': [
'<!@(<(build_dir)/bin/curl-impersonate-chrome-config --static-libs | node -e "console.log(require(\'fs\').readFileSync(0, \'utf-8\').split(\' \').filter(i => i.startsWith(\'-L\')).join(\' \').replace(/-L/g, \'\'))")'
'<!@(<(build_dir)/bin/curl-impersonate-config --static-libs | node -e "console.log(require(\'fs\').readFileSync(0, \'utf-8\').split(\' \').filter(i => i.startsWith(\'-L\')).join(\' \').replace(/-L/g, \'\'))")'
],
},
}],
Expand Down
2 changes: 1 addition & 1 deletion deps/curl-impersonate
Submodule curl-impersonate updated 84 files
+28 −23 .github/workflows/build-and-test-make.yml
+4 −3 .github/workflows/build-win.yaml
+9 −9 INSTALL.md
+155 −83 Makefile.in
+51 −50 README.md
+1 −1 bin/curl_chrome100
+1 −1 bin/curl_chrome101
+1 −1 bin/curl_chrome104
+1 −1 bin/curl_chrome107
+1 −1 bin/curl_chrome110
+1 −1 bin/curl_chrome116
+2 −2 bin/curl_chrome119
+2 −2 bin/curl_chrome120
+2 −2 bin/curl_chrome123
+2 −2 bin/curl_chrome124
+2 −2 bin/curl_chrome131
+2 −2 bin/curl_chrome131_android
+2 −2 bin/curl_chrome133a
+37 −0 bin/curl_chrome136
+1 −1 bin/curl_chrome99
+1 −1 bin/curl_chrome99_android
+1 −1 bin/curl_edge101
+1 −1 bin/curl_edge99
+4 −3 bin/curl_firefox133
+4 −3 bin/curl_firefox135
+1 −1 bin/curl_safari153
+1 −1 bin/curl_safari155
+1 −1 bin/curl_safari170
+1 −1 bin/curl_safari172_ios
+1 −1 bin/curl_safari180
+1 −1 bin/curl_safari180_ios
+32 −0 bin/curl_safari184
+32 −0 bin/curl_safari184_ios
+39 −0 bin/curl_tor145
+12 −82 browsers.json
+1 −1 configure.ac
+4 −4 docker/alpine.dockerfile
+4 −4 docker/debian.dockerfile
+4 −4 docker/dockerfile.mustache
+1 −1 docs/01_introduction.md
+2 −2 docs/02_install.md
+3 −3 docs/03_usage.md
+3 −3 docs/07_with_php.md
+138 −187 patches/boringssl.patch
+1,322 −1,426 patches/curl.patch
+1 −1 tests/Dockerfile
+1 −1 tests/README.md
+144 −0 tests/signatures/chrome_136.0.7103.93.yaml
+135 −0 tests/signatures/safari_18.4_iOS.yaml
+138 −0 tests/signatures/safari_18.4_macOS.yaml
+130 −0 tests/signatures/tor_14.5_macOS.yaml
+67 −35 tests/targets.yaml
+5 −52 tests/test_impersonate.py
+0 −0 win/bin/curl_chrome100.bat
+0 −0 win/bin/curl_chrome101.bat
+0 −0 win/bin/curl_chrome104.bat
+0 −0 win/bin/curl_chrome107.bat
+0 −0 win/bin/curl_chrome110.bat
+0 −0 win/bin/curl_chrome116.bat
+1 −1 win/bin/curl_chrome119.bat
+1 −1 win/bin/curl_chrome120.bat
+1 −1 win/bin/curl_chrome123.bat
+1 −1 win/bin/curl_chrome124.bat
+1 −1 win/bin/curl_chrome131.bat
+1 −1 win/bin/curl_chrome131_android.bat
+1 −1 win/bin/curl_chrome133a.bat
+33 −0 win/bin/curl_chrome136.bat
+0 −0 win/bin/curl_chrome99.bat
+0 −0 win/bin/curl_chrome99_android.bat
+0 −0 win/bin/curl_edge101.bat
+0 −0 win/bin/curl_edge99.bat
+1 −1 win/bin/curl_firefox133.bat
+1 −1 win/bin/curl_firefox135.bat
+0 −0 win/bin/curl_safari153.bat
+0 −0 win/bin/curl_safari155.bat
+0 −0 win/bin/curl_safari170.bat
+0 −0 win/bin/curl_safari172_ios.bat
+0 −0 win/bin/curl_safari180.bat
+0 −0 win/bin/curl_safari180_ios.bat
+28 −0 win/bin/curl_safari184.bat
+28 −0 win/bin/curl_safari184_ios.bat
+35 −0 win/bin/curl_tor145.bat
+20 −4 win/build.bat
+8 −4 win/deps.sh
13 changes: 7 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ SRC_ARTIFACTS_FILE="$BUILD_DIR/curl-impersonate.src.tar.gz"
BUILD_ARTIFACTS_FILE="$BUILD_DIR/curl-impersonate.tar.gz"
OS=$(uname -s)

BORINGSSL_COMMIT="23768dca563c4e62d48bb3675e49e34955dced12"
BORINGSSL_COMMIT="673e61fc215b178a90c0e67858bbf162c8158993"
BORINGSSL_SRC_DIR="$BUILD_DIR/boringssl-$BORINGSSL_COMMIT"

BROTLI_VERSION="1.1.0"
BROTLI_SRC_DIR="$BUILD_DIR/brotli-$BROTLI_VERSION"
BROTLI_OUT_DIR="$BROTLI_SRC_DIR/out/installed"

CURL_VERSION="8_7_1"
CURL_VERSION="8_13_0"
CURL_SRC_DIR="$BUILD_DIR/curl-$CURL_VERSION"
CURL_OUT_DIR="$BUILD_DIR/curl-impersonate"

Expand Down Expand Up @@ -48,7 +48,7 @@ fi

# Build BoringSSL
build_boringssl() {
$MAKE chrome-build
$MAKE build
}

# Build zlib
Expand Down Expand Up @@ -117,9 +117,9 @@ configure_build() {

# Build Curl Impersonate
build_curl_impersonate() {
$MAKE chrome-build
$MAKE chrome-checkbuild
$MAKE chrome-install
$MAKE build
$MAKE checkbuild
$MAKE install

# copy curl include dir
mkdir -p "$CURL_OUT_DIR/include"
Expand Down Expand Up @@ -168,6 +168,7 @@ main() {
# Create install directory
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
export CFLAGS="-fPIC"

# Build zlib
echo "Building zlib..."
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail
cd "$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd -P)/.."

CURL_IMPERSONATE_VERSION="0.9.4"
CURL_IMPERSONATE_VERSION="1.0.0"

# no action required if binding exists
if [[ -f lib/binding/node_libcurl_ja3.node ]]; then
Expand Down