Cloudflare Worker

ProxyBridge

ProxyBridge is a lightweight proxy server that securely relays HTTP requests between clients and backend services.

URL structure

https://proxybridge.focket.app/api/relay/<your-api-path>
  ?webUrl=<your-frontend-origin>
  &baseApiUrl=<your-backend-base-url>

Query parameters

ParamRequiredDescription
webUrl Yes Frontend origin used for CORS Access-Control-Allow-Origin and upstream Origin.
baseApiUrl Yes Backend base URL. The relay path is appended to this.
acceptHeadersKey No Comma-separated request header names to forward (e.g. authorization,x-tenant-id).
any other No Forwarded verbatim to the upstream API as query params.

First call (fetch)

const PROXY = 'https://proxybridge.focket.app';
const WEB_URL = 'https://app.example.com';
const API_BASE = 'https://api.example.com';

const res = await fetch(
  `${PROXY}/api/relay/users` +
  `?webUrl=${encodeURIComponent(WEB_URL)}` +
  `&baseApiUrl=${encodeURIComponent(API_BASE)}`
);
const data = await res.json();

With axios + Authorization

const { data } = await axios.get(`${PROXY}/api/relay/orders`, {
  params: {
    webUrl: WEB_URL,
    baseApiUrl: API_BASE,
    acceptHeadersKey: 'authorization',
  },
  headers: {
    Authorization: 'Bearer <token>',
  },
});

POST example

const res = await fetch(
  `${PROXY}/api/relay/users` +
  `?webUrl=${encodeURIComponent(WEB_URL)}` +
  `&baseApiUrl=${encodeURIComponent(API_BASE)}` +
  `&acceptHeadersKey=authorization`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer <token>',
    },
    body: JSON.stringify({ name: 'Ada', email: 'ada@example.com' }),
  }
);

Response shape

{
  "success": true,
  "statusCode": 200,
  "message": "Successfully Retrieved!",
  "data": { /* upstream data or full JSON */ },
  "meta": null
}

Errors