Discord-friendly Reddit embed proxy, like FixupX but for Reddit links.
Discord often shows weak Reddit embeds. This app turns Reddit post URLs into pages with clean OpenGraph/Twitter metadata so Discord can embed title, text, image, video, gallery preview, upvotes, comments.
Deploy this app, set BASE_URL, then share links like:
https://your-domain.example/r/pics/comments/abc123/title/Or:
https://your-domain.example/?url=https://www.reddit.com/r/pics/comments/abc123/title/Browsers redirect/open the Reddit post. Bots receive metadata.
pnpm installpnpm startDev mode:
pnpm devCopy .env.example values into your host env.
| Env | Default | Purpose |
|---|---|---|
PORT |
3000 |
HTTP port |
HOST |
0.0.0.0 |
bind host |
BASE_URL |
http://localhost:3000 |
public app origin |
REDIRECT_BROWSERS |
true |
redirect non-bot browsers |
CACHE_TTL_MS |
300000 |
Reddit cache TTL |
FETCH_TIMEOUT_MS |
8000 |
Reddit fetch timeout |
RATE_LIMIT_MAX |
120 |
requests/window |
RATE_LIMIT_WINDOW |
1 minute |
Fastify rate limit window |
MOCK_REDDIT |
false |
use built-in mock Reddit response for local/offline tests |
REDDIT_COOKIES |
empty | optional Reddit cookies for hosts/IPs that get 403; accepts raw Cookie header, cookie file path, JSON, Netscape cookies, or URL |
Public Reddit JSON endpoints may return 403 from some hosts/IPs. This app uses Reddit's unauthenticated JSON endpoints with a descriptive User-Agent.
If Reddit still returns 403, set REDDIT_COOKIES.
Raw browser Cookie header:
REDDIT_COOKIES="loid=...; session_tracker=...; reddit_session=..."
pnpm startCookie file path:
REDDIT_COOKIES="./cookies.txt"
pnpm startSupported REDDIT_COOKIES inputs:
- raw
Cookieheader:a=b; c=d - plain cookie file
- Netscape cookie export
- JSON object:
{"a":"b"} - JSON array:
[{"name":"a","value":"b"}] http(s)URL returning any supported cookie format
Security: Reddit cookies grant account access. Do not commit them, paste them in logs, or expose them in hosting dashboards.
/r/:sub/comments/:id/:slug?/user/:user/comments/:id/:slug?/u/:user/comments/:id/:slug?/?url=https://www.reddit.com/...redd.it/:idviaurl=mode
Real Reddit fetch:
curl -A "Discordbot/2.0" "http://localhost:3000/r/pics/comments/abc123/title/"Offline/local mock mode, useful if Reddit is blocked by ISP/VPN:
MOCK_REDDIT=true pnpm start
curl -A "Discordbot/2.0" "http://localhost:3000/r/test/comments/mock123/title/"Windows cmd.exe:
set MOCK_REDDIT=true&& pnpm startDocker mock mode:
docker run --rm -p 3000:3000 -e MOCK_REDDIT=true reddit-discord-fixExpected: HTML containing og:title, og:description, og:image or og:video.
- No DB.
- In-memory cache only.
- SSRF blocked by allowing only Reddit hosts in
url=mode. - Reddit API/network failures return embeddable error pages.