Skip to content

Deploy to Cloudflare Workers ​

⏱️ 8 min · Level: Beginner

Harmony deploys as a single-file Cloudflare Worker β€” no build tools, no dependencies, no wrangler config. You edit worker.js in-place, paste it into the Cloudflare dashboard, and the resulting Worker URL becomes your live VLESS subscription endpoint. Every time a client calls "Update Subscriptions", the Worker re-fetches fresh clean IPs and regenerates all configurations on the fly.

Prerequisites ​

Before you begin the deployment, you need two pieces of information extracted from an existing VLESS proxy Worker (created separately via tools like [ZiZifn], [BPB], or [CMLiu]):

PrerequisiteWhat It IsWhere to Find It
UUIDYour VLESS user identifier (v4 format)Inside your existing VLESS config string, after vless:// and before @
HostnameYour proxy Worker's *.workers.dev domainIn your Cloudflare dashboard under Workers β†’ your Worker β†’ Preview / Triggers tab

If you don't yet have a VLESS proxy Worker, create one first using any compatible generator, then return here. Harmony is a subscription generator β€” it wraps your existing proxy endpoint with automatic clean IP injection.

Deployment Flow ​

The entire process follows a linear path from download to live subscription:

Step 1 β€” Download and Edit worker.js ​

Download or copy the raw worker.js file from the repository. Open it in any text editor β€” Notepad++ on Windows, MT Manager on Android, or the GitHub web editor all work. You will make exactly three categories of edits in the USER_SETTINGS object at the top of the file:

1a. Replace the UUID ​

On line 32, replace the default UUID with your own:

LineBeforeAfter
32uuid: "a22bff60-a40a-4250-bde2-4c660e363b47"uuid: "your-actual-uuid-here"

1b. Replace Hostname and SNI per Group ​

The groups array contains three configuration groups by default. Each group's host and sni must point to your proxy Worker's domain. For Workers hosted on Cloudflare, the SNI value is always identical to the hostname.

GroupPurposehost Linesni LineNote
Group 1 (TLS)Harmonyα΅€α΄ΈΛ’Line 55Line 56Both values = your Worker hostname
Group 2 (Non-TLS)Harmonyα΅€αΆœα΄ΎLine 69Line 70SNI must remain "" (empty)
Group 3 (Alt TLS)Harmonyα΄±α΄ΉΛ’Line 83Line 84Both values = your Worker hostname

non-TLS

For Group 2 (non-TLS/TCP), the sni field must stay empty β€” this is not a placeholder. Non-TLS configurations do not use Server Name Indication. Only replace the host value on line 69.

1c. Save the File ​

Save the edited file locally. The filename must remain worker.js β€” Cloudflare Workers require this exact filename when pasting code into the dashboard editor.

Step 2 β€” Create the Worker in Cloudflare ​

Navigate to the Cloudflare dashboard and follow these steps:

StepActionDetail
1Add a WorkerClick the Add icon (or + on mobile) in the top toolbar, then select Workers
2Start from Hello WorldClick Get Started next to "Start with Hello World!"
3Name your WorkerChoose any name (e.g., harmony-sub). Click Deploy
4Open the editorAfter deployment completes, click Edit Code
5Clear default codeDelete all of the default Hello World content
6Paste your codePaste the entire contents of your edited worker.js (Ctrl+V on PC, or upload on mobile)
7DeployClick the blue Deploy button in the top-right corner

After clicking Deploy, the editor view remains open. Click the Visit button β€” a new browser tab opens displaying a Base64-encoded string. That string is your live subscription output.

Copy the URL from the browser's address bar. This is your subscription link. It follows the pattern:

text
https://your-worker-name.your-subdomain.workers.dev

Optionally, you can customize the profile title seen in your client by appending a query parameter or hash:

MethodURL FormatExample
Query param?name=MyProfilehttps://harmony-sub.xxx.workers.dev?name=MyProfile
Hash fragment#MyProfilehttps://harmony-sub.xxx.workers.dev#MyProfile

If neither is provided, the default title is "Harmony".

Step 4 β€” Add to Your VLESS Client ​

Paste the Worker URL as a subscription link in any VLESS-compatible client (v2rayN, NekoBox, Clash Meta, etc.). Each time you press Update Subscriptions, the Worker:

  1. Fetches fresh clean IPs from all configured sources in parallel
  2. Shuffles and deduplicates the IP lists
  3. Generates ipCount VLESS configs per group (default: 10 Γ— 3 groups = 30 configs)
  4. Returns a Base64-encoded subscription with fake usage headers

Configuration Quick Reference ​

The USER_SETTINGS object controls all behavior. Here is a summary of every field you may want to change:

FieldLineDefaultDescription
uuid32(placeholder)Your VLESS UUID β€” must change
ipCount3510Number of configs generated per group
ed38"2560"Early Data max size (bytes)
eh39"Sec-WebSocket-Protocol"Early Data header name

Each group object supports these fields:

FieldRequiredDescriptionDeep Dive Page
nameYesDisplay name prefix for configsβ€”
hostYesYour proxy Worker hostnameUUID and Hostname Setup
sniYesServer Name Indication (empty for non-TLS)UUID and Hostname Setup
pathYesWebSocket path (supports random:N syntax)Path Obfuscation
tlsYesEnable TLS for this groupPorts and ALPN Settings
portsYesArray of ports to cycle throughPorts and ALPN Settings
alpnYesALPN value (empty for non-TLS)Ports and ALPN Settings
fpYesClient fingerprint arrayFingerprint and Early Data
dataSourceYes"static", "dynamic1", or "dynamic2"IP Data Sources
randomizeSniYesRandomize SNI casing for anti-detectionSNI Case Randomization
allowInsecureNoSkip TLS verification (false recommended)β€”

Troubleshooting ​

SymptomLikely CauseFix
Base64 output is empty or minimalDynamic IP sources are unreachableFallback to static IPs is automatic; check internet connectivity. Ensure ipCount > 0
All configs share the same IPOnly one source returned dataVerify dataSource points to an available source. Try "static" as a known-good fallback
Client rejects the subscriptionUUID is still the placeholderReplace the default UUID on line 32 with your actual VLESS UUID
Non-TLS configs fail to connectSNI is set for a non-TLS groupEnsure Group 2's sni is "" (empty string) and alpn is ""
Worker returns an error responseSyntax error in edited codeRe-download a fresh worker.js and re-apply only the three required edits
Configs show wrong hostnamehost not replaced in all groupsReplace host in every group object (lines 55, 69, 83)

Fuβ˜…β˜…d up

If you accidentally corrupt the file, the safest recovery is to re-download a clean worker.js from the repository and re-apply only the UUID and hostname edits. The remaining 1100+ lines (IP lists, fetch logic, link builder) should never be manually modified.

Next Steps ​

Your Harmony Worker is now live. To go deeper into configuration and optimization:

  • β€” understand how the fetch pipeline, IP sources, and link builder interact
  • β€” detailed reference for the two most critical parameters
  • β€” learn how static, dynamic1, and dynamic2 sources differ and when to use each
  • β€” customize group count, names, and port selections