somratpro commited on
Commit
b2383c3
ยท
1 Parent(s): 4b00189

docs: add guide for creating a free Cloudflare proxy to bypass Discord connection blocks

Browse files
Files changed (2) hide show
  1. DISCORD_PROXY_GUIDE.md +45 -0
  2. README.md +8 -0
DISCORD_PROXY_GUIDE.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ๐Ÿ› ๏ธ How to Create a Free Discord Proxy
2
+
3
+ Hugging Face officially blocks outgoing connections to Discord's IP addresses on Free Tier Spaces to prevent spam. While our built-in DNS script cleanly bypasses blocks for Telegram and WhatsApp, Discord is blocked at the physical IP firewall level.
4
+
5
+ This means the native n8n "Discord" node will always hang and fail with a "Connection closed unexpectedly" error.
6
+
7
+ To work around this, you can easily create your own private Discord proxy using Cloudflare Workers. It takes about 2 minutes and is 100% free (allowing up to 100,000 requests per day).
8
+
9
+ ## Step-by-Step Guide
10
+
11
+ ### Step 1: Create a Cloudflare Worker
12
+ 1. Log into [Cloudflare](https://dash.cloudflare.com/) (create an account if you don't have one).
13
+ 2. On the left sidebar, go to **Workers & Pages**.
14
+ 3. Click **Create Worker** -> **Start with Hello World!**.
15
+ 4. Name it something memorable, like `discord-proxy`, and click **Deploy**.
16
+
17
+ ### Step 2: Add the Proxy Code
18
+ 1. Once deployed, click the **Edit Code** button.
19
+ 2. In the online code editor, delete the existing code and replace it entirely with this 6-line snippet:
20
+
21
+ ```javascript
22
+ export default {
23
+ async fetch(request) {
24
+ const url = new URL(request.url);
25
+ url.hostname = 'discord.com';
26
+ return fetch(new Request(url, request));
27
+ }
28
+ }
29
+ ```
30
+
31
+ 3. Click **Save and Deploy** in the top right corner. Cloudflare will generate a unique URL for you (e.g., `https://discord-proxy.yourname.workers.dev`).
32
+
33
+ ### Step 3: Use the Proxy in n8n
34
+ Because the native Discord Node hardcodes connections to `discord.com` when using Bot tokens, you must use the **Webhook** method.
35
+
36
+ 1. Add the standard **Discord** node to your n8n workflow.
37
+ 2. Under "Authentication", select **Webhook**.
38
+ 3. Take your normal Discord Webhook URL and replace `discord.com` with your new worker domain.
39
+ * *Original:* `https://discord.com/api/webhooks/123456/abcdef`
40
+ * *New:* `https://discord-proxy.yourname.workers.dev/api/webhooks/123456/abcdef`
41
+ 4. Create a new Discord Webhook Credential in n8n and paste that **New URL** into the "Webhook URL" field.
42
+ 5. Setup your message (e.g., set the text to "Hello World") and click **Execute Node**. Your message will instantly appear in Discord!
43
+
44
+ ---
45
+ *Note: If you ever upgrade your Hugging Face Space to a paid hardware tier, the outgoing firewall restriction is removed, and you can go back to using the native n8n Discord node directly!*
README.md CHANGED
@@ -66,6 +66,14 @@ Hugging8n automatically creates and maintains a private dataset in your Hugging
66
  - **Sync Status:** You can check the current sync health directly on the Hugging8n Dashboard.
67
  - **Restoration:** On every startup, Hugging8n pulls the latest state from your dataset before launching n8n.
68
 
 
 
 
 
 
 
 
 
69
  ## ๐Ÿ—๏ธ Architecture
70
 
71
  - `/` : **Premium Dashboard** (Management & Monitoring)
 
66
  - **Sync Status:** You can check the current sync health directly on the Hugging8n Dashboard.
67
  - **Restoration:** On every startup, Hugging8n pulls the latest state from your dataset before launching n8n.
68
 
69
+ ## โš ๏ธ Known Limitations & Workarounds
70
+
71
+ **Discord Webhooks**
72
+ Hugging Face officially blocks outgoing connections to Discord on Free Tier Spaces. To use the Discord node, you must route your traffic through a simple, free proxy.
73
+
74
+ ๐Ÿ‘‰ **[Read the Guide: How to Create a Free Discord Proxy in 2 minutes](./DISCORD_PROXY_GUIDE.md)**
75
+ *(Upgrading to a paid Space removes this firewall restriction entirely).*
76
+
77
  ## ๐Ÿ—๏ธ Architecture
78
 
79
  - `/` : **Premium Dashboard** (Management & Monitoring)