green-tunnel 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -112
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,160 +1,172 @@
|
|
|
1
1
|
# Green Tunnel
|
|
2
|
+
|
|
2
3
|
<p align="center">
|
|
3
4
|
<img src="assets/logo.png" alt="green tunnel logo" width="200">
|
|
4
5
|
</p>
|
|
5
6
|
<p align="center">
|
|
6
|
-
<img src="https://img.shields.io/github/license/SadeghHayeri/GreenTunnel.svg?color=Green&style=for-the-badge">
|
|
7
|
+
<img src="https://img.shields.io/github/license/SadeghHayeri/GreenTunnel.svg?color=Green&style=for-the-badge">
|
|
8
|
+
<img src="https://img.shields.io/npm/v/green-tunnel?color=Green&style=for-the-badge">
|
|
9
|
+
<img src="https://img.shields.io/github/repo-size/SadeghHayeri/GreenTunnel.svg?color=Green&style=for-the-badge">
|
|
7
10
|
</p>
|
|
8
11
|
|
|
9
12
|
GreenTunnel bypasses DPI (Deep Packet Inspection) systems found in many ISPs (Internet Service Providers) which block access to certain websites.
|
|
10
13
|
|
|
14
|
+
> **Note:** GreenTunnel does not hide your IP address. It only bypasses DPI-based censorship.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<table>
|
|
19
|
+
<tr>
|
|
20
|
+
<td width="340"><img src="assets/new-version.png" alt="GreenTunnel v2.0.0 new UI" width="320"></td>
|
|
21
|
+
<td valign="top" style="padding-left: 24px;">
|
|
22
|
+
|
|
23
|
+
**GreenTunnel v2 — with the help of [Claude Code](https://code.claude.com/docs/en/overview) — is out now.**
|
|
24
|
+
|
|
25
|
+
After years of silence, this project is alive again. The entire codebase has been rebuilt from the ground up: native ESM, Node.js 20+, a brand new dark UI, and a clean dependency tree with zero known vulnerabilities.
|
|
26
|
+
|
|
27
|
+
Open-source tools that help people reach the free internet shouldn't die — and with AI-assisted development, they don't have to. We'll keep doing our best to help people access the open internet, one packet at a time.
|
|
28
|
+
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
11
33
|
<p align="center">
|
|
12
|
-
<img src="assets/demo.gif" alt="green tunnel demo"
|
|
34
|
+
<img src="assets/demo.gif" alt="green tunnel demo">
|
|
13
35
|
</p>
|
|
14
36
|
|
|
15
|
-
|
|
16
|
-
### Graphical user interface (GUI)
|
|
17
|
-
You can simply choose the suitable installation for your OS in the [releases](https://github.com/SadeghHayeri/GreenTunnel/releases "releases") section.
|
|
37
|
+
---
|
|
18
38
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
$ npm i -g green-tunnel
|
|
23
|
-
```
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
### Requirements
|
|
24
42
|
|
|
25
|
-
|
|
43
|
+
- **Node.js 20+**
|
|
44
|
+
|
|
45
|
+
### npm (recommended)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install -g green-tunnel
|
|
26
49
|
```
|
|
27
|
-
|
|
50
|
+
|
|
51
|
+
After installation, run with `gt` or `green-tunnel`.
|
|
52
|
+
|
|
53
|
+
### Docker
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
docker run -p 8000:8000 sadeghhayeri/greentunnel
|
|
28
57
|
```
|
|
29
58
|
|
|
59
|
+
---
|
|
30
60
|
|
|
31
|
-
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
### CLI
|
|
32
64
|
|
|
33
65
|
```
|
|
34
|
-
$ gt --help
|
|
35
66
|
Usage: green-tunnel [options]
|
|
36
67
|
Usage: gt [options]
|
|
37
68
|
|
|
38
69
|
Options:
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--dns-
|
|
45
|
-
--dns-
|
|
46
|
-
--
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--
|
|
50
|
-
--
|
|
51
|
-
|
|
52
|
-
Examples:
|
|
53
|
-
gt
|
|
54
|
-
gt --ip 127.0.0.1 --port 8000 --https-only
|
|
55
|
-
gt --dns-server https://doh.securedns.eu/dns-query
|
|
56
|
-
gt --verbose 'green-tunnel:proxy*'
|
|
57
|
-
|
|
58
|
-
ISSUES: https://github.com/SadeghHayeri/GreenTunnel/issues
|
|
70
|
+
--ip IP address to bind proxy server [string] [default: "127.0.0.1"]
|
|
71
|
+
--port Port to bind proxy server [number] [default: 8000]
|
|
72
|
+
--https-only Block insecure HTTP requests [boolean] [default: false]
|
|
73
|
+
--dns-type DNS resolver type [string] [choices: "https", "tls", "unencrypted"] [default: "https"]
|
|
74
|
+
--dns-server DNS server URL [string] [default: "https://cloudflare-dns.com/dns-query"]
|
|
75
|
+
--dns-ip IP for unencrypted DNS [string] [default: "127.0.0.1"]
|
|
76
|
+
--dns-port Port for unencrypted DNS [number] [default: 53]
|
|
77
|
+
--tls-record-frag... Enable TLS record fragmentation [boolean] [default: false]
|
|
78
|
+
--silent, -s Run in silent mode [boolean] [default: false]
|
|
79
|
+
--verbose, -v Debug mode (e.g. 'green-tunnel:*') [string]
|
|
80
|
+
--system-proxy Auto-set system proxy [boolean] [default: true]
|
|
81
|
+
--help, -h Show help
|
|
82
|
+
--version, -V Show version number
|
|
59
83
|
```
|
|
60
84
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
**Examples:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Basic usage (auto-sets system proxy)
|
|
89
|
+
gt
|
|
90
|
+
|
|
91
|
+
# Custom port
|
|
92
|
+
gt --port 9000
|
|
93
|
+
|
|
94
|
+
# Use a different DoH server
|
|
95
|
+
gt --dns-server https://doh.securedns.eu/dns-query
|
|
96
|
+
|
|
97
|
+
# Enable TLS record fragmentation (for stricter DPI)
|
|
98
|
+
gt --tls-record-fragmentation
|
|
99
|
+
|
|
100
|
+
# Debug mode
|
|
101
|
+
gt --verbose 'green-tunnel:*'
|
|
64
102
|
```
|
|
65
103
|
|
|
66
104
|
### Docker
|
|
67
|
-
```
|
|
68
|
-
$ docker run -p 8000:8000 sadeghhayeri/green-tunnel
|
|
69
|
-
```
|
|
70
|
-
> **envs**
|
|
71
|
-
* PORT
|
|
72
|
-
* HTTPS-ONLY
|
|
73
|
-
* VERBOSE
|
|
74
|
-
* SILENT
|
|
75
|
-
* DNS_TYPE
|
|
76
|
-
* DNS_SERVER
|
|
77
|
-
|
|
78
|
-
usage:
|
|
79
|
-
```
|
|
80
|
-
$ docker run -e 'PORT=1000' -p 8000:1000 sadeghhayeri/green-tunnel
|
|
81
|
-
```
|
|
82
105
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
106
|
+
```bash
|
|
107
|
+
# Basic
|
|
108
|
+
docker run -p 8000:8000 sadeghhayeri/greentunnel
|
|
87
109
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
110
|
+
# Custom port
|
|
111
|
+
docker run -e PORT=9000 -p 9000:9000 sadeghhayeri/greentunnel
|
|
112
|
+
|
|
113
|
+
# Run in background, restart on reboot
|
|
114
|
+
docker run -d --restart unless-stopped -p 8000:8000 sadeghhayeri/greentunnel
|
|
91
115
|
```
|
|
92
116
|
|
|
93
|
-
|
|
117
|
+
**Environment variables:**
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
| Variable | Description | Default |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| `PORT` | Proxy port | `8000` |
|
|
122
|
+
| `HTTPS_ONLY` | Block HTTP traffic | `false` |
|
|
123
|
+
| `DNS_TYPE` | `https`, `tls`, or `unencrypted` | `https` |
|
|
124
|
+
| `DNS_SERVER` | DNS server URL | Cloudflare DoH |
|
|
125
|
+
| `SILENT` | Suppress output | `false` |
|
|
126
|
+
| `VERBOSE` | Debug namespace | — |
|
|
96
127
|
|
|
97
|
-
###
|
|
98
|
-
- MacOS Catalina with node 12
|
|
99
|
-
- Ubuntu 18.04 with node 8
|
|
100
|
-
- Windows 10 with node 8
|
|
128
|
+
### Graphical Interface (GUI)
|
|
101
129
|
|
|
130
|
+
Download the pre-built installer for your OS from the [releases](https://github.com/SadeghHayeri/GreenTunnel/releases) page.
|
|
102
131
|
|
|
103
|
-
|
|
104
|
-
> **How does it work?**
|
|
105
|
-
###### HTTP
|
|
106
|
-
There are gaps in providers in DPI. They happen from what the DPI rules write for ordinary user programs, omitting all possible cases that are permissible by standards. This is done for simplicity and speed.
|
|
107
|
-
Some DPIs cannot recognize the HTTP request if it is divided into TCP segments. For example, a request of the form
|
|
132
|
+
---
|
|
108
133
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
## How It Works
|
|
135
|
+
|
|
136
|
+
### HTTP
|
|
137
|
+
|
|
138
|
+
Some DPI systems fail to detect blocked content when an HTTP request is split across multiple TCP segments. GreenTunnel splits the request so the `Host` header straddles a segment boundary, preventing the DPI from matching the blocked hostname.
|
|
139
|
+
|
|
140
|
+
### HTTPS / SNI Fragmentation
|
|
141
|
+
|
|
142
|
+
TLS's Server Name Indication (SNI) extension sends the target hostname in plaintext during the handshake. DPI systems use this to block HTTPS connections. GreenTunnel splits the initial `ClientHello` TLS record into small fragments so the DPI cannot reassemble and inspect the SNI field.
|
|
143
|
+
|
|
144
|
+
Optionally, `--tls-record-fragmentation` breaks the TLS record at a lower level for stricter DPI environments.
|
|
115
145
|
|
|
116
|
-
|
|
117
|
-
Server Name Indication (SNI) is an extension to TLS (Transport Layer Security) that indicates the actual destination hostname a client is attempting to access over HTTPS. For this Web Filter feature, SNI hostname information is used for blocking access to specific sites over HTTPS. For example, if the administrator chooses to block the hostname **youtube** using this feature, all Website access attempts over HTTPS that contain **youtube** like **www.youtube.com** in the SNI would be blocked. However, access to the same hostname over HTTP would not be blocked by this feature. GreenTunnel tries to split first **CLIENT-HELLO** packet into small chunks and ISPs can't parse packet and found SNI field so bypass traffic!
|
|
146
|
+
### Encrypted DNS
|
|
118
147
|
|
|
119
|
-
|
|
120
|
-
When you enter a URL in a Web browser, the first thing the Web browser does is to ask a DNS (Domain Name System) server, at a known numeric address, to look up the domain name referenced in the URL and supply the corresponding IP address.
|
|
121
|
-
If the DNS server is configured to block access, it consults a blacklist of banned domain names. When a browser requests the IP address for one of these domain names, the DNS server gives a wrong answer or no answer at all.
|
|
122
|
-
GreenTunnel use [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS "doh (DNS over HTTPS)") and [DNS over TLS](https://en.wikipedia.org/wiki/DNS_over_TLS "DNS over TLS") to get real IP address and bypass DNS Spoofing.
|
|
148
|
+
Standard DNS lookups can be intercepted or spoofed by ISPs to block domains at the DNS level. GreenTunnel uses **DNS over HTTPS (DoH)** or **DNS over TLS (DoT)** to get the real IP address, bypassing DNS-based blocking.
|
|
123
149
|
|
|
124
|
-
|
|
125
|
-
GreenTunnel is an open-source app and I really appreciate other developers adding new features and/or helping fix bugs. If you want to contribute to GreenTunnel, you can fork this repository, make the changes and create a pull request.
|
|
150
|
+
---
|
|
126
151
|
|
|
127
|
-
|
|
152
|
+
## Contributing
|
|
128
153
|
|
|
129
|
-
|
|
130
|
-
- For bugs and feature requests, please create an issue.
|
|
131
|
-
- Make sure your pull request has an informative title. You should use prefixes like `ADD:`, `FIX:`, etc at the start of the title which describes the changes followed by a one-line description of the changes. Example: ADD: Added a new feature to GreenTunnel
|
|
132
|
-
- Commits in your fork should be informative, as well. Make sure you don't combine too many changes into a single commit.
|
|
154
|
+
Pull requests and issues are always welcome.
|
|
133
155
|
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- [ ] add preferences menu
|
|
140
|
-
- [ ] fix close button
|
|
156
|
+
- Use `FIX:`, `ADD:`, `UPDATE:` prefixes in PR titles.
|
|
157
|
+
- Keep commits focused and descriptive.
|
|
158
|
+
- Make sure `npm install` passes and `node -e "import('./src/index.js')"` works.
|
|
159
|
+
|
|
160
|
+
---
|
|
141
161
|
|
|
142
162
|
## Donation
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
**RIPPLE/XRP:** rt6ZTkKdBVYzBee9CpQsDTsewnTbAoV13<br />
|
|
150
|
-
|
|
151
|
-
[](https://payping.ir/d/TXTS)
|
|
152
|
-
<br />
|
|
153
|
-
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HJ5TBXVYTHS7N¤cy_code=USD&source=url)
|
|
154
|
-
<br />
|
|
155
|
-
[](https://en.cryptobadges.io/donate/bc1qknjsmsa98lljwxjwl4pmjh48s8su8r8ajkqd8w)
|
|
156
|
-
[](https://en.cryptobadges.io/donate/0x018fbf3fAC7165b2c85f856cC90E2d9410415150)
|
|
157
|
-
[](https://en.cryptobadges.io/donate/rt6ZTkKdBVYzBee9CpQsDTsewnTbAoV13)
|
|
163
|
+
|
|
164
|
+
> Love GreenTunnel? Please consider donating to sustain development.
|
|
165
|
+
|
|
166
|
+
**Ethereum / USDT (ERC-20):** `0xB116a6AE50c38a455944A65f9cEE4D54CEceF080`
|
|
167
|
+
|
|
168
|
+
---
|
|
158
169
|
|
|
159
170
|
## License
|
|
160
|
-
|
|
171
|
+
|
|
172
|
+
Licensed under the [MIT License](https://github.com/SadeghHayeri/GreenTunnel/blob/main/LICENSE).
|