mirror of
https://github.com/lwthiker/curl-impersonate.git
synced 2026-09-13 12:15:53 +00:00
Use different binary names for Firefox and Chrome
Rename the binary files of curl-impersonate so that the Firefox and Chrome versions can co-exist on the same system. The Firefox version is now named 'curl-impersonate-ff' and 'libcurl-impersonate-ff' and the Chrome version is named 'curl-impersonate-chrome' and 'libcurl-impersonate-chrome'. The wrapper scripts look for these names as well. Symbolic names with the old names are still created inside the Docker images to keep compatibility as much as possible.
This commit is contained in:
+6
-3
@@ -92,7 +92,8 @@ RUN cd ${CURL_VERSION} && \
|
||||
make
|
||||
|
||||
RUN mkdir out && \
|
||||
cp ${CURL_VERSION}/src/curl out/curl-impersonate && \
|
||||
cp ${CURL_VERSION}/src/curl out/curl-impersonate-ff && \
|
||||
ln -s curl-impersonate-ff out/curl-impersonate && \
|
||||
strip out/curl-impersonate
|
||||
|
||||
# Re-compile libcurl dynamically
|
||||
@@ -108,8 +109,10 @@ RUN cd ${CURL_VERSION} && \
|
||||
# symbolic links.
|
||||
RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \
|
||||
major=$(echo -n $ver | cut -d'.' -f1) && \
|
||||
cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \
|
||||
ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \
|
||||
cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate-ff.so.$ver" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate-ff.so.$major" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate-ff.so" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate.so.$ver" && \
|
||||
ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \
|
||||
strip "out/libcurl-impersonate.so.$ver"
|
||||
|
||||
|
||||
@@ -87,7 +87,8 @@ RUN cd ${CURL_VERSION} && \
|
||||
make
|
||||
|
||||
RUN mkdir out && \
|
||||
cp ${CURL_VERSION}/src/curl out/curl-impersonate && \
|
||||
cp ${CURL_VERSION}/src/curl out/curl-impersonate-ff && \
|
||||
ln -s curl-impersonate-ff out/curl-impersonate && \
|
||||
strip out/curl-impersonate
|
||||
|
||||
# Re-compile libcurl dynamically
|
||||
@@ -103,8 +104,10 @@ RUN cd ${CURL_VERSION} && \
|
||||
# symbolic links.
|
||||
RUN ver=$(readlink -f curl-7.81.0/lib/.libs/libcurl.so | sed 's/.*so\.//') && \
|
||||
major=$(echo -n $ver | cut -d'.' -f1) && \
|
||||
cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate.so.$ver" && \
|
||||
ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so.$major" && \
|
||||
cp "${CURL_VERSION}/lib/.libs/libcurl.so.$ver" "out/libcurl-impersonate-ff.so.$ver" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate-ff.so.$major" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate-ff.so" && \
|
||||
ln -s "libcurl-impersonate-ff.so.$ver" "out/libcurl-impersonate.so.$ver" && \
|
||||
ln -s "libcurl-impersonate.so.$ver" "out/libcurl-impersonate.so" && \
|
||||
strip "out/libcurl-impersonate.so.$ver"
|
||||
|
||||
@@ -123,7 +126,8 @@ FROM alpine:3.15.0
|
||||
RUN apk add --no-cache nss
|
||||
|
||||
# Copy curl-impersonate from the builder image
|
||||
COPY --from=builder /build/out/curl-impersonate /usr/local/bin/
|
||||
COPY --from=builder /build/out/curl-impersonate-ff /usr/local/bin/
|
||||
RUN ln -s curl-impersonate-ff /usr/local/bin/curl-impersonate
|
||||
# Wrapper scripts
|
||||
COPY --from=builder /build/out/curl_* /usr/local/bin/
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'`
|
||||
# The list of ciphers can be obtained by looking at the Client Hello message in
|
||||
# Wireshark, then converting it using the cipherlist array at
|
||||
# https://github.com/curl/curl/blob/master/lib/vtls/nss.c
|
||||
"$dir/curl-impersonate" \
|
||||
"$dir/curl-impersonate-ff" \
|
||||
--ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha,rsa_3des_ede_cbc_sha \
|
||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0' \
|
||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'`
|
||||
# The list of ciphers can be obtained by looking at the Client Hello message in
|
||||
# Wireshark, then converting it using the cipherlist array at
|
||||
# https://github.com/curl/curl/blob/master/lib/vtls/nss.c
|
||||
"$dir/curl-impersonate" \
|
||||
"$dir/curl-impersonate-ff" \
|
||||
--ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha \
|
||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0' \
|
||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
|
||||
|
||||
Regular → Executable
+1
-1
@@ -6,7 +6,7 @@ dir=`echo "$0" | sed 's%/[^/]*$%%'`
|
||||
# The list of ciphers can be obtained by looking at the Client Hello message in
|
||||
# Wireshark, then converting it using the cipherlist array at
|
||||
# https://github.com/curl/curl/blob/master/lib/vtls/nss.c
|
||||
"$dir/curl-impersonate" \
|
||||
"$dir/curl-impersonate-ff" \
|
||||
--ciphers aes_128_gcm_sha_256,chacha20_poly1305_sha_256,aes_256_gcm_sha_384,ecdhe_ecdsa_aes_128_gcm_sha_256,ecdhe_rsa_aes_128_gcm_sha_256,ecdhe_ecdsa_chacha20_poly1305_sha_256,ecdhe_rsa_chacha20_poly1305_sha_256,ecdhe_ecdsa_aes_256_gcm_sha_384,ecdhe_rsa_aes_256_gcm_sha_384,ecdhe_ecdsa_aes_256_sha,ecdhe_ecdsa_aes_128_sha,ecdhe_rsa_aes_128_sha,ecdhe_rsa_aes_256_sha,rsa_aes_128_gcm_sha_256,rsa_aes_256_gcm_sha_384,rsa_aes_128_sha,rsa_aes_256_sha \
|
||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0' \
|
||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' \
|
||||
|
||||
Reference in New Issue
Block a user