Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Proxy Sync

ASecurity

Keeps the Cloudflare Worker (worker.js) and Node.js dev proxy (dev-proxy.mjs) in sync. MUST activate when editing either proxy file.

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
developmentnextjsnode

Works with

cli

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add gethamster/skills --skill proxy-sync --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Proxy Sync?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Proxy Sync
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gethamster-proxy-sync/badge)](https://www.skillsdirectory.com/skills/gethamster-proxy-sync)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: proxy-sync
description: "Keeps the Cloudflare Worker (worker.js) and Node.js dev proxy (dev-proxy.mjs) in sync. MUST activate when editing either proxy file."
version: "1.1.0"
---

# Proxy Sync

## Overview

The core-proxy package has two proxy implementations that MUST stay in sync:

| File | Runtime | Used In |
| --- | --- | --- |
| `worker.js` | Cloudflare Workers (workerd) | Production, staging, remote dev |
| `dev-proxy.mjs` | Node.js (native `node:http`) | Local development (`pnpm dev`) |

The Node.js proxy exists because workerd's single-threaded local runtime bottlenecks at ~3 concurrent requests. The production Cloudflare Worker has no such limit.

## CRITICAL: What Must Stay in Sync

When editing **either** file, you MUST update the other to match:

### 1. Route Definitions

Both files define the same route arrays. Any path added/removed/reordered in one MUST be mirrored:

| Route Group | worker.js variable | dev-proxy.mjs variable |
| --- | --- | --- |
| Supabase paths | `supabasePaths` | `SUPABASE_PATHS` |
| Service paths (NestJS) | `servicePaths` | `SERVICE_PATHS` |
| Studio app paths | `studioAppPaths` | `STUDIO_APP_PATHS` |
| Studio public paths | `studioPublicPaths` | `STUDIO_PUBLIC_PATHS` |

### 2. Routing Priority

The evaluation order MUST be identical:

1. Root path `/` -> website
2. Supabase paths -> Supabase (MUST come before studio to avoid `/auth/v1/` matching `/auth/`)
3. Service paths (`/ai/*`) -> NestJS (strip `/ai` prefix)
4. Studio app paths -> Next.js
5. `/_site/*` -> Website (strip `/_site` prefix)
6. `/_next/*` -> Next.js
7. Studio public paths -> Next.js
8. Default -> Website

### 3. Header Forwarding

Both proxies set these headers identically:

- `host` -> target host
- `x-forwarded-host` -> original request host
- `x-forwarded-proto` -> original protocol
- `x-forwarded-for` -> client IP (pass-through)
- `x-forwarded-origin` -> original origin (for Server Actions CSRF)

### 4. Redirect Rewriting

Both proxies rewrite `Location` headers on 3xx responses for these routes:

- Root path (`/`)
- Studio app paths
- Default website fallback

Internal service URLs in Location headers are rewritten to the public proxy origin.

### 5. WebSocket Upgrade Handling

Both proxies forward WebSocket upgrades for:

- `/realtime/v1/` -> Supabase
- `/ai/` -> NestJS (voice gateway)
- `/_site/` -> Website (HMR)
- `/_next/` -> Next.js (HMR)

### 6. Environment Variables

Both use the same four upstream URLs:

| Variable | worker.js source | dev-proxy.mjs source |
| --- | --- | --- |
| Supabase URL | `env.SUPABASE_URL_ENV` | `process.env.SUPABASE_URL_ENV` |
| NestJS URL | `env.NEST_URL_ENV` | `process.env.NEST_URL_ENV` |
| Next.js URL | `env.NEXT_URL_ENV` | `process.env.NEXT_URL_ENV` |
| Website URL | `env.WEBSITE_URL_ENV` | `process.env.WEBSITE_URL_ENV` |

Default values for local dev are defined in:

- `wrangler.toml` `[env.local.vars]` for worker.js
- Inline defaults in dev-proxy.mjs
- `package.json` `dev` script env vars for dev-proxy.mjs

### 7. Error Responses

Both return the same error shape:

- Network errors: `503 Service Unavailable` with `{ "error": "<ServiceName> unavailable" }`
- WebSocket failures: `502 Bad Gateway`
- Catch-all: `500 Internal Server Error` with `{ "error": "Internal server error" }`

## Verification Checklist

After editing either proxy file, verify:

- [ ] All route path arrays contain the same entries in the same order
- [ ] Routing priority (evaluation order) is identical
- [ ] All forwarded headers are set identically
- [ ] Redirect rewriting applies to the same routes
- [ ] WebSocket upgrade paths match
- [ ] Error responses use the same status codes and JSON shape
- [ ] Any new upstream URL is added to both files

Attribution

gethamstergethamster
View sourceSee grades on GitHubMore from gethamster →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →