⚠️ proxy-config-worker is deprecated, please migrate to proxy-render(https://github.com/TBXark/proxy-render)
An online proxy configuration adaptation tool for Cloudflare worker.
Demo: https://proxy-config.tbxark.workers.dev
Cloudflare worker Tutorials can be found here.
Further documentation for Wrangler can be found here.
Install from the command line:
npm install @tbxark/[email protected]
Install via package.json
:
"@tbxark/proxy-config-worker": "1.0.9"
npm i @cloudflare/wrangler -g
mkdir your-worker-name
cd your-worker-name
wrangler init your-worker-name --type webpack
npm init
npm install @tbxark/[email protected]
Fill in the configuration in wrangler.toml
account_id = "your-account-id"
vars = { DOMAIN = "your-worker-name.your-name.workers.dev" }
import Application from '@tbxark/proxy-config-worker/index'
import HookConfig from '@tbxark/proxy-config-worker/src/hook/config'
HookConfig.after = async (token, port, style, config) => {
return config + '\n\n#Powered by tbxark'
}
addEventListener('fetch', event => {
event.respondWith(Application.handleRequest(event.request))
})
addEventListener('scheduled', event => {
event.waitUntil(Application.handleSchedule(event.scheduledTime))
})