Skip to content

Commit

Permalink
fix password
Browse files Browse the repository at this point in the history
  • Loading branch information
6Kmfi6HP committed Sep 13, 2024
1 parent cf16fba commit 212c16e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ ask question and cloudflare ips: [https://t.me/edtunnel](https://t.me/edtunnel)

2. Clone this repository deploy in cloudflare pages.

3. Add `nodejs_compat` at setting Compatibility flags

![note](image/image.png)

## Deploy in worker.dev

1. Copy `_worker.js` code from [here](https://github.com/6Kmfi6HP/EDtunnel/blob/main/_worker.js).
Expand All @@ -40,9 +44,38 @@ ask question and cloudflare ips: [https://t.me/edtunnel](https://t.me/edtunnel)

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/6Kmfi6HP/EDtunnel)

3. Noneed add `nodejs_compat` at setting Compatibility flags

## How to change UUID

1. edit `wrangler.toml` file `UUID` variable(not recommended at public repo)
2. edit `UUID` in cloudflare dashboard secret enviroment variable (recommended)

## Support Environment Variables

| Variable | Required | Example | Description |
| -------------- | -------- | --------------------------------------- | ---------------------------------- |
| `UUID` | No | `12345678-1234-1234-1234-123456789012` | Unique identifier |
| `PROXYIP` | No | `1.1.1.1` or `cdn.xn--b6gac.eu.org` | Redirct cloudflare ips to ProxyIP |
| `SOCKS5` | No | `1.1.1.1:1080` or `user:pass@host:port` | SOCKS5 proxy cloudflare ips |
| `SOCKS5_RELAY` | No | `true` or `false` | Enable SOCKS5 relaying all traffic |

### Enviroment variable setting workers

![workes](image/image-1.png)

### Enviroment variable setting pages

![pages](image/image-2.png)

## How to use trojan

1. the `UUID` enviroment variable is `trojan` password
2. v2ray path is `/trojan`

## Lazy to deploy

`aHR0cHM6Ly9vc3MudjJyYXlzZS5jb20vcHJveGllcy9kYXRhLzIwMjMtMDctMzAvRnJFS1lvQS50eHQ=` (free clash.meta subscribe config)
subscribe link`https://sub.xf.free.hr/auto` (auto detect client config)

## UUID Setting (Optional)

Expand Down
Binary file added image/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default {
proxyIP = PROXYIP || proxyIP;
socks5Address = SOCKS5 || socks5Address;
socks5Relay = SOCKS5_RELAY || socks5Relay;
sha224Password = env.SHA224 || env.SHA224PASS || sha256.sha224(userID);


if (socks5Address) {
try {
Expand Down Expand Up @@ -859,7 +861,7 @@ async function parseTrojanHeader(buffer) {
}

const password = new TextDecoder().decode(buffer.slice(0, 56));
if (password !== Sha256.sha224(userID)) {
if (password !== sha224Password) {
return { hasError: true, message: "Invalid password" };
}

Expand Down

0 comments on commit 212c16e

Please sign in to comment.