fastify/fastify-http-proxy

can register proxy by host

evlon opened this issue ยท 3 comments

evlon commented

Prerequisites

  • I have written a descriptive issue title
  • 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
})

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.

I think it is already implemented in #182

constraints: opts.constraints || {},

The follow-up update should be documentation only

I think it is already implemented in #182

constraints: opts.constraints || {},

The follow-up update should be documentation only

This works, but not for websockets. Websocket support currently ignores the host constraint.