-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also use sccache releases instead of building with cargo.
- Loading branch information
Showing
6 changed files
with
90 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
A secure, censorship-resistent proxy. | ||
|
||
NaïveProxy is naive as it reuses standard protocols (HTTP/2, HTTP/3) and common network stacks (Chrome, Caddy) with little variation. By being as common and boring as possible NaïveProxy is practically indistinguishable from mainstream traffic. Reusing common software stacks also ensures best practices in performance and security. | ||
NaïveProxy is naïve as it reuses standard protocols (HTTP/2, HTTP/3) and common network stacks (Chrome, Caddy) with little variation. By being as common and boring as possible NaïveProxy is practically indistinguishable from mainstream traffic. Reusing common software stacks also ensures best practices in performance and security. | ||
|
||
The following attacks are mitigated: | ||
|
||
|
@@ -13,7 +13,7 @@ The following attacks are mitigated: | |
|
||
## Architecture | ||
|
||
[Browser → Naive (client)] ⟶ Censor ⟶ [Frontend → Naive (server)] ⟶ Internet | ||
[Browser → Naïve (client)] ⟶ Censor ⟶ [Frontend → Naïve (server)] ⟶ Internet | ||
|
||
NaïveProxy uses Chrome's network stack. What the censor can see is exactly regular HTTP/2 traffic between Chrome and standard Frontend (e.g. Caddy, HAProxy). | ||
|
||
|
@@ -29,12 +29,18 @@ Note: On Linux libnss3 must be installed before using the prebuilt binary. | |
|
||
## Setup | ||
|
||
Locally run `./naive --proxy=https://user:[email protected]` and point the browser to a SOCKS5 proxy at port 1080. | ||
On the server, download Caddy (from https://caddyserver.com/download with plugin: http.forwardproxy): | ||
``` | ||
curl -OJ 'https://caddyserver.com/download/linux/amd64?plugins=http.forwardproxy&license=personal' | ||
tar xf ./caddy_*.tar.gz | ||
sudo setcap cap_net_bind_service=+ep caddy | ||
``` | ||
|
||
On the server run `./caddy` as the frontend with the following Caddyfile | ||
Run `./caddy` with the following Caddyfile (replace the example values accordingly): | ||
``` | ||
domain.example | ||
root /var/www/html | ||
tls [email protected] | ||
forwardproxy { | ||
basicauth user pass | ||
hide_ip | ||
|
@@ -43,9 +49,28 @@ forwardproxy { | |
upstream http://127.0.0.1:8080 | ||
} | ||
``` | ||
and `./naive --listen=http://127.0.0.1:8080` behind it. See [Server Setup](https://github.com/klzgrad/naiveproxy/wiki/Server-Setup) for more details on building Caddy and enabling QUIC. | ||
|
||
For more information on parameter usage and format of `config.json`, see [USAGE.txt](https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt). See also [Parameter Tuning](https://github.com/klzgrad/naiveproxy/wiki/Parameter-Tuning) to improve client-side performance. | ||
and `./naive` with the following `config.json`: | ||
```json | ||
{ | ||
"listen": "http:/127.0.0.1:8080", | ||
"padding": true | ||
} | ||
``` | ||
|
||
Locally run `./naive` with `config.json`: | ||
```json | ||
{ | ||
"listen": "socks://127.0.0.1:1080", | ||
"proxy": "https://user:[email protected]", | ||
"padding": true | ||
} | ||
``` | ||
to get a SOCKS5 proxy at local port 1080. | ||
|
||
See [USAGE.txt](https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt) on how to configure `config.json`. See also [Parameter Tuning](https://github.com/klzgrad/naiveproxy/wiki/Parameter-Tuning) to improve client-side performance. | ||
|
||
It's possible to run Caddy without Naive server, but you need to remove `padding` from `config.json` and `upstream` from Caddyfile. | ||
|
||
## Build | ||
|
||
|
@@ -56,15 +81,14 @@ Prerequisites: | |
* MacOS (brew install): git, ninja, ccache (optional) | ||
* Windows ([choco install](https://chocolatey.org/)): git, python2, ninja, visualstudio2017community. See [Chromium's page](https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Visual-Studio) for detail on Visual Studio setup requirements. | ||
|
||
|
||
Build (output to `./out/Release/naive`): | ||
``` | ||
git clone https://github.com/klzgrad/naiveproxy.git | ||
cd naiveproxy/src | ||
./get-clang.sh | ||
./build.sh | ||
``` | ||
The scripts download tools from Google servers with curl. If there is trouble try to set a proxy environment variable for curl, e.g. `export ALL_PROXY=socks5h://127.0.0.1:1080`. | ||
The scripts download tools from Google servers with curl. You may need to set a proxy environment variable for curl, e.g. `export ALL_PROXY=socks5h://127.0.0.1:1080`. | ||
|
||
## FAQ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"listen": "socks://127.0.0.1:1080", | ||
"proxy": "https://user:[email protected]", | ||
"padding": false, | ||
"log": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters