fastify-http-proxy icon indicating copy to clipboard operation
fastify-http-proxy copied to clipboard

can register proxy by host

Open evlon opened this issue 4 years ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

can register proxy by host name

Motivation

No response

Example

server.register(proxy, {
  upstream: 'http://single-signon.example.com',
  host: 'xxx.sample.com', // optional
  http2: false // optional
})

evlon avatar Dec 05 '21 13:12 evlon

This would be a good feature to add!

Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Check out https://www.fastify.io/docs/latest/Routes/#constraints, it's likely just about passing this to the routes.

mcollina avatar Dec 06 '21 08:12 mcollina

I think it is already implemented in https://github.com/fastify/fastify-http-proxy/pull/182 https://github.com/fastify/fastify-http-proxy/blob/04e49eb25e29eb6254b0cc22aa8058163a2328cc/index.js#L174

The follow-up update should be documentation only

climba03003 avatar Dec 06 '21 09:12 climba03003