Commit Graph
22 Commits
Author SHA1 Message Date
MythEclipseandClaude Fable 5 c61f8d9db6 fix: try direct connection first, fall back to proxy
Change proxy strategy: first attempt goes direct (no proxy).
Only if direct fails, fall back to proxy pool with rotation.
This way healthy upstreams don't pay the proxy latency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 22:15:47 +07:00
MythEclipseandClaude Fable 5 03427cae8c feat: auto-rotate proxy pool with retry on network failure
- Add src/lib/proxy-pool.ts: round-robin proxy pool that reads
  proxy.txt (host:port:user:pass), tracks consecutive failures,
  and rotates on threshold
- Integrate into src/index.ts: on fetch network error, mark proxy
  as failed, rotate to next, and retry the request once
- proxy.txt loaded from PROXY_FILE/PROXY_LIST env var or ./proxy.txt
- Graceful no-op when proxy.txt doesn't exist (Vercel/Workers)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 22:12:59 +07:00
MythEclipseandClaude Fable 5 3f96d8a6e7 fix: relay requests to / with x-relay-target instead of showing index
When a GET request hits / with an x-relay-target header, it should relay
the request — not display the index page. Fixed in all three entry points
(src/index.ts, api/relay.ts, src/worker.ts).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 21:59:25 +07:00
MythEclipseandClaude Fable 5 7a4df35371 feat: add Cloudflare Workers deployment support
- Create src/worker.ts: Workers-compatible relay handler using env
  bindings instead of process.env, exports { fetch } for Workers runtime
- Update wrangler.toml: point to new src/worker.ts entry point
- Update deploy.yml: add wrangler-action deploy step after tests pass
- The worker reuses the same relay logic from src/lib/ and src/middleware/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 21:38:22 +07:00
MythEclipseandClaude Fable 5 f58a92e2aa feat: migrate from Next.js to pure Bun relay proxy
- Replace Next.js app router with standalone Bun.serve() entry point
- Add middleware stack: rate limiter, body limiter, structured logger, SSRF protection
- Add WebSocket bidirectional relay via x-relay-target header
- Implement error classification (DNS→502, timeouts→504, SSRF→403, rate→429)
- Remove all Next.js dependencies and config files
- Update deploy workflow, tsconfig, wrangler config for Bun deployment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 19:54:55 +07:00
MythEclipse 443ff77be9 ci: add CF Workers deploy workflow + fix relay header forwarding 2026-05-08 18:58:50 +07:00
MythEclipseandClaude Opus 4.7 75731af9b6 Remove edge runtime directive from route handler
Cloudflare Workers via OpenNext tidak support Next.js edge runtime.
Hapus export const runtime = "edge" agar handler jalan di Workers runtime.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 17:32:35 +07:00
MythEclipse 6a82a834eb refactor: remove unnecessary targetUrl parameter and prevent compressed responses in relay 2026-05-07 23:09:49 +07:00
MythEclipse 6f91d93672 feat: restructure API and documentation with new relay handler and UI components 2026-05-07 22:55:23 +07:00
MythEclipse 6588c2bc39 test: add unit tests for relay-utils functions 2026-05-07 22:41:08 +07:00
MythEclipse 932bc192fa feat: integrate Geist font and enhance layout with utility classes
feat: update Home component with new UI elements and improved request handling

chore: add components.json for component configuration

feat: implement Badge component for status indication

feat: create Button component for consistent styling

feat: develop Card component structure for content display

feat: add Input component for user input fields

feat: implement Label component for form accessibility

feat: create Select component for dropdown functionality

feat: add Separator component for visual separation

feat: implement Toaster component for notifications

feat: create Tabs component for tabbed navigation

feat: add Textarea component for multi-line input

feat: add utility functions for class name management
2026-05-07 22:30:50 +07:00
MythEclipse f691476046 fix: prevent encoding issues by removing problematic headers in relay responses 2026-05-07 22:25:39 +07:00
MythEclipse 1a0a947674 Refactor code structure for improved readability and maintainability 2026-05-07 22:22:35 +07:00
MythEclipse 83e66805c4 refactor: remove Tailwind CSS configuration and update dependencies 2026-05-07 21:34:39 +07:00
MythEclipse 001bba1d24 fix: add CORS headers to relay responses and OPTIONS method handling 2026-05-07 21:31:00 +07:00
MythEclipse 7416bfb2bd feat: migrate proxy logic to new structure and implement new relay route 2026-05-07 21:26:27 +07:00
MythEclipse f3ec82cbbf fix: replace stripRelayHeaders with filterHeaders and add BLOCKED_HEADERS set 2026-05-07 21:16:31 +07:00
MythEclipse 9d1ef77cda fix: update duplex type assertion in buildRelayRequest function 2026-05-07 21:07:39 +07:00
MythEclipse b0dde3c885 refactor: migrate to Next.js with edge functions and update relay utilities
- Removed old relay utilities and tests, replacing them with a new structure under `src/lib/relay-utils.ts`.
- Implemented a new edge function in `app/api/proxy/route.ts` to handle proxy requests.
- Created a new Next.js layout and page structure for the frontend, including a user interface for testing the proxy.
- Added Tailwind CSS for styling and configured PostCSS.
- Updated TypeScript configuration for better compatibility with Next.js.
- Removed unused files and configurations related to the previous setup.
2026-05-07 20:59:23 +07:00
MythEclipse 149a646fea fix: correct typo in comment for allowed methods 2026-05-07 20:08:04 +07:00
MythEclipse b4f5bad19d feat: enhance request handling with method validation and target URL checks 2026-05-07 19:22:28 +07:00
MythEclipse 86ca59ad8e refactor: restructure project by moving and renaming files, and implementing relay utilities 2026-05-07 19:12:46 +07:00