Skip to content

Commit 9b6af34

Browse files
committed
Convert docs to sphix RST format
1 parent f279e7b commit 9b6af34

30 files changed

Lines changed: 1537 additions & 493 deletions

.readthedocs.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.13"
12+
13+
# Build documentation in the "docs/" directory with Sphinx
14+
sphinx:
15+
configuration: docs/conf.py
16+
17+
python:
18+
install:
19+
- method: uv
20+
command: sync
21+
path: docs

INSTALL.md

Lines changed: 1 addition & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,161 +1 @@
1-
# Building and installing curl-impersonate
2-
3-
This guide shows how to compile and install curl-impersonate and libcurl-impersonate from source.
4-
The build process takes care of downloading dependencies, patching them, compiling them and finally compiling curl itself with the needed patches.
5-
There are currently three build options depending on your use case:
6-
7-
* [Native build](#native-build) using an autotools-based Makefile
8-
* [Cross compiling](#cross-compiling) using an autotools-based Makefile
9-
* [Docker container build](#docker-build)
10-
11-
Unlike the upstream project, there is only one version in this fork, namely the Chrome version, for impersonating all main stream browsers.
12-
13-
## Native build
14-
15-
### Ubuntu
16-
17-
Install dependencies for building all the components:
18-
19-
```sh
20-
sudo apt install build-essential pkg-config cmake ninja-build curl autoconf automake libtool
21-
sudo apt install golang-go unzip
22-
sudo apt install zstd libzstd-dev
23-
```
24-
25-
Clone this repository:
26-
27-
```sh
28-
git clone https://github.com/lexiforest/curl-impersonate.git
29-
cd curl-impersonate
30-
```
31-
32-
Configure and compile:
33-
34-
```sh
35-
mkdir build && cd build
36-
../configure
37-
# Build and install
38-
make build
39-
sudo make install
40-
# You may need to update the linker's cache to find libcurl-impersonate
41-
sudo ldconfig
42-
# Optionally remove all the build files
43-
cd ../ && rm -Rf build
44-
```
45-
46-
This will install curl-impersonate, libcurl-impersonate and the wrapper scripts to `/usr/local`. To change the installation path, pass `--prefix=/path/to/install/` to the `configure` script.
47-
48-
After installation you can run the wrapper scripts, e.g.:
49-
50-
```sh
51-
curl_chrome119 https://www.example.com
52-
```
53-
54-
or run directly with you own flags:
55-
56-
```sh
57-
curl-impersonate https://www.example.com
58-
```
59-
60-
### Red Hat based (CentOS/Fedora/Amazon Linux)
61-
62-
Install dependencies:
63-
64-
```sh
65-
yum groupinstall "Development Tools"
66-
yum groupinstall "C Development Tools and Libraries" # Fedora only
67-
yum install cmake3 python3 python3-pip
68-
# Install Ninja. This may depend on your system.
69-
yum install ninja-build
70-
# OR
71-
pip3 install ninja
72-
yum install zstd libzstd-devel
73-
```
74-
75-
For the Chrome version, install Go.
76-
You may need to follow the [Go installation instructions](https://go.dev/doc/install) if it's not packaged for your system:
77-
78-
```sh
79-
yum install golang
80-
```
81-
82-
Then follow the 'Ubuntu' instructions for the actual build.
83-
84-
### macOS
85-
86-
Install dependencies for building all the components:
87-
88-
```sh
89-
brew install pkg-config make cmake ninja autoconf automake libtool
90-
brew install zstd
91-
brew install go
92-
```
93-
94-
Clone this repository:
95-
96-
```sh
97-
git clone https://github.com/lexiforest/curl-impersonate.git
98-
cd curl-impersonate
99-
```
100-
101-
Configure and compile:
102-
103-
```sh
104-
mkdir build && cd build
105-
../configure
106-
# Build and install
107-
gmake build
108-
sudo gmake install
109-
# Optionally remove all the build files
110-
cd ../ && rm -Rf build
111-
```
112-
113-
### Static compilation
114-
115-
To compile curl-impersonate statically with libcurl-impersonate, pass `--enable-static` to the `configure` script.
116-
117-
118-
## Cross compiling
119-
120-
There is some basic support for cross compiling curl-impersonate.
121-
It is currently being used to build curl-impersonate for ARM64 (aarch64) systems from x86-64 systems.
122-
Cross compiling is similar to the usual build but a bit trickier:
123-
124-
* You'd have to build zlib and zstd for the target architecture so that curl can link with it.
125-
* Some paths have to be specified manually since curl's own build system can't determine their location.
126-
127-
An example build for aarch64 on Ubuntu x86_64:
128-
129-
```sh
130-
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
131-
132-
./configure --host=aarch64-linux-gnu \
133-
--with-zlib=/path/to/compiled/zlib \
134-
--with-zstd=/path/to/compiled/zstd \
135-
--with-ca-path=/etc/ssl/certs \
136-
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
137-
138-
make build
139-
```
140-
141-
The flags mean as follows:
142-
`--with-zlib/zstd` is the location of a compiled zlib/zstd library for the target architecture.
143-
`--with-ca-path` and `--with-ca-bundle` will be passed to curl's configure script as is.
144-
145-
## Docker build
146-
147-
The Docker build is a bit more reproducible and serves as the reference implementation. It creates a Debian-based Docker image with the binaries.
148-
149-
[`chrome/Dockerfile`](chrome/Dockerfile) is a debian-based Dockerfile that will build curl with all the necessary modifications and patches. Build it like the following:
150-
151-
```sh
152-
docker build -t curl-impersonate chrome/
153-
```
154-
155-
The resulting binaries and libraries are in the `/usr/local` directory, which contains:
156-
157-
* `curl-impersonate`, - The curl binary that can impersonate Chrome/Edge/Safari. It is compiled statically against libcurl, BoringSSL, and libnghttp2 so that it won't conflict with any existing libraries on your system. You can use it from the container or copy it out. Tested to work on Ubuntu 20.04.
158-
* `curl_chrome99`, `curl_chrome100`, `...` - Wrapper scripts that launch `curl-impersonate` with all the needed flags.
159-
* `libcurl-impersonate.so`, `libcurl-impersonate.so` - libcurl compiled with impersonation support. See [libcurl-impersonate](README.md#libcurl-impersonate) for more details.
160-
161-
You can use them inside the docker, copy them out using `docker cp` or use them in a multi-stage docker build.
1+
See docs/install.rst and docs/building.rst.

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
> 7. Single binary to support Chrome, Safari and Firefox.
1717
> 8. Built with http/3 enabled, http/3 and quic fingerprints are also supported.
1818
> 9. A user-friendly Python binding: [curl_cffi](https://github.com/lexiforest/curl_cffi).
19-
> 10. More prebuilt binaries, including Windows, Arm, and even RISC-V!
20-
> 11. Commercial support at [impersonate.pro](https://impersonate.pro).
19+
> 10. A user-friendly Nodejs TypeScript binding: [impers](https://github.com/lexiforest/impers).
20+
> 11. More prebuilt binaries, including Windows, Arm, and even RISC-V!
21+
> 12. Commercial support at [impersonate.pro](https://impersonate.pro).
2122
2223
> [!WARNING]
2324
> Breaking changes on v1.0, see release page for details.
@@ -67,7 +68,7 @@ Read the original technical description in the blog posts: [part a](https://lwth
6768

6869
## Supported browsers
6970

70-
The following browsers can be impersonated.
71+
The following browsers can be impersonated. For a full list of browser profiles, visit the [docs](https://curl-impersonate.readthedocs.com).
7172

7273
| Browser | Version | OS | Target name | Wrapper script | H3 fingerprints |
7374
| --- | --- | --- | --- | --- | --- |
@@ -122,7 +123,8 @@ Notes:
122123
## Install
123124

124125
The simplest way is to download the prebuilt binaries from the [release page](https://github.com/lexiforest/curl-impersonate/releases).
125-
If you want to build by yourself, please refer to the [INSTALL.md](INSTALL.md) and [docs/install.md](docs/02_install.md).
126+
If you want to build by yourself, please refer to [INSTALL.md](INSTALL.md) and
127+
[docs/install.rst](docs/install.rst).
126128

127129
You can also use the following docker images:
128130

docs/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

docs/01_introduction.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/02_install.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

docs/03_usage.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)