Comments (10)
nevermind, it was actually my fault, i've used curl_reset
, which remove the parameters set using CURL_IMPERSONATE=chrome98
from curl-impersonate.
Alright, you also need to launch with the LD_PRELOAD
env var to replace the default libcurl with libcurl-impersonate
from curl-impersonate.
i've modified the library file system wide so I don't need to prepend each execution of my script with LD_PRELOAD.
curl_reset is really useful because i'm reusing my connection between requests, and some parameters set on a previous request might not be useful on a following request.
Do you have an idea how to reset without resetting the settings that I can't configure from php ? Because i'm not sure how to properly reset everthing to their default value, like CURLOPT_COOKIEJAR or CURLOPT_PROXY, but I set many parameters, not only those two.
That's why curl_reset is useful for me
maybe curl_easy_reset could reset to the default curl_impersonate values ? https://github.com/curl/curl/blob/2610142139d14265ed9acf9ed83cdf73d6bb4d05/lib/easy.c#L959
from curl-impersonate.
I'll have to look how to change curl_easy_reset()
so that the curl-impersonate options are preserved. Probably an internal call to curl_easy_impersonate()
right after will do the trick but this has to be checked more thoroughly.
In the meantime, I guess you could just cleanup the handle and create a new one. Does curl_reset()
actually preserve the connection or just saves you from destroying the old handle and creating a new one?
from curl-impersonate.
curl_reset keep the connection, so doing mutliple requests on the same website is much faster than closing and reiniting curl for each request
from curl-impersonate.
I see. Then patching curl_easy_reset()
is probably the way to go. If you wanna give it a shot you are welcome - probably need to add something similar to this in the reset function. If not I'll have a look at this later.
from curl-impersonate.
@momala454 You may want to try #44. curl_easy_reset()
is now patched as well, so that the necessary curl options for impersonation are retained (currently for the Chrome version only). I did some manual testing and it looks OK. Please test with your PHP app and let me know if it fixes the issue for you.
from curl-impersonate.
thank you, i will test this next week
from curl-impersonate.
i have a small problem with your pull request (actually, with the whole libcurl version). When i'm using CURL_IMPERSONATE=chrome98
, i'm unable to overwrite the default user-agent header to Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
it stays with Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
when I set CURLOPT_USERAGENT, it does not overwrite the default user-agent set with "CURL_IMPERSONATE" env variable. It only reset it if I modify the header "user-agent" using CURLOPT_HTTPHEADER
beside this small thing, the fix is working fine thank you
from curl-impersonate.
Got it, I'll open a separate issue for this. This one will be closed once I merge #44
from curl-impersonate.
Related Issues (20)
- support for 118 HOT 5
- Bypassing a specific site behind cloudflare HOT 3
- Unable to build firefox or chrome due to SSL interpreting warnings as errors. HOT 8
- Custom order of the TLS Extensions
- Homebrew recipe? HOT 1
- JA4+ HOT 2
- Homebrew unofficial receipt available HOT 1
- Ubuntu 22:04 libcurl-impersonate-chrome.so cannot be preloaded HOT 3
- Websocket on Windows HOT 6
- Pre shared key extension
- make chrome-build fails HOT 1
- Fiddler Intergration / Cloudfare bypass
- WS/WSS Protocol in Docker Image HOT 3
- compile error on boringssl - [-Werror,-Wunused-but-set-variable] HOT 3
- Content-Encoding may be gzip but the response body is uncompressed
- Safari http2 fingerprints are not correct
- make chrome-build failed HOT 7
- Bypassing Cloudflare HOT 6
- Impersonation no longer good enough?
- recompile php with curl-impersonate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl-impersonate.