ReviewOS

stacks/rpx

Support `changeOrigin`

#33
Closed brianjenkins94 opened this 11 days ago ·
11 days ago

Clear and concise description of the problem

From https://github.com/http-party/node-http-proxy

changeOrigin: true/false, Default: false - changes the origin of the host header to the target URL

Suggested solution

.

Alternative

No response

Additional context

No response

Validations

11 days ago

For reference: https://github.com/http-party/node-http-proxy/blob/9b96cd725127a024dabebec6c7ea8c807272223d/lib/http-proxy/common.js#L99-L104

11 days ago

Thanks for opening this up! I will tackle this shortly

11 days ago

Implemented this — finally! 🎉

changeOrigin is now fully supported (and documented). When enabled, rpx rewrites the Origin header to the upstream target, mirroring http-proxy's changeOrigin option — useful when your dev server enforces CORS or same-origin checks.

// rpx.config.ts
export default {
  from: 'localhost:5173',
  to: 'my-app.localhost',
  changeOrigin: true,
}

Or from the CLI:

rpx start --from localhost:5173 --to my-app.localhost --change-origin

In a multi-proxy config it can be a shared default with per-proxy overrides. Shipped in c972d2d with real pool- and handler-level tests plus config/CLI/API docs. Thanks for the report, @brianjenkins94!

11 days ago

Just wondering, you guys seem to be a working on a massive, cool-sounding thing. How can I learn more? Maybe you have a discord? My username is the same as on here.

Sign in to comment on this issue.