This repository contains a new worker.js that aims for better solutions in terms of performance and features regarding common worker issues such as supporting IPv6, the UDP protocol, and more stable communication with Cloudflare IPs (loopback connections).
As you know, Cloudflare workers are currently unable to connect to hosts that have Cloudflare IPs (this is considered a loopback).This worker uses relay nodes to work around that limitation.
The worker also implements an advanced DNS DOH client/proxy for dns routing/serving purposes.
├── src
│ ├── dns.js // DNS message encoding/parsing
│ └── worker.ts // Main worker code
├── dist
│ └── worker.js // Compiled worker script
To manually deploy the worker:
You can deploy this worker to your Cloudflare account automatically with one click using the button below.
1. Follow the relay set-up instructions to run your own relay server.
2. Edit the worker.js
file and add your server IP or domain to the proxyIPs
array.
In the worker.js
file, locate the following code:
// src/worker.ts
var proxyIPs = ["relay1.bepass.org", "relay2.bepass.org", "relay3.bepass.org"];
var proxyPort = 6666;
var proxyIP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)];
Remove public relay addresses and Add the IP address or domain of your relay server. For example:
// src/worker.ts
var proxyIPs = ["relay.example.com", "123.45.67.89"]; // Add your server IP/domain here
var proxyPort = 6666;
var proxyIP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)];
Cloudflare's free workers are limited to 100,000 requests per day. This is sufficient for personal use by one user or a small family.
For most personal usage, the free worker should be adequate. But if you experience rate limiting, you may need to deploy workers on multiple accounts.
Clone the bepass-worker repository:
git clone https://github.com/uoosef/bepass-worker
Change to the project directory:
cd bepass-worker
Install the dependencies:
npm install
npm run build && node dist/worker.js
npm test
- [X]
Task 1: Implement worker's range detection
- [X]
Task 2: Better loopback support
- [X]
Task 3: DNS Resolving
- [ ]
Task 4: ...
Contributions are always welcome! Please follow these steps:
new-feature-branch
or bugfix-issue-123
).
git checkout -b new-feature-branch
git commit -m 'Implemented new feature.'
git push origin new-feature-branch
This project is licensed under the MIT License - see the LICENSE file for details.