fastify/fastify-http-proxy

Allow specifying constraints

dominik-korsa opened this issue ยท 2 comments

Prerequisites

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

๐Ÿš€ Feature Proposal

Allow specifying custom constraints on routes matched by the proxy

https://github.com/fastify/fastify-http-proxy/blob/master/index.js#L176-L182

Motivation

This would be a potential solution for the problem described in #129

Example

import FastifyHttpProxy from 'fastify-http-proxy';
import Fastify from 'fastify';

const fastify = Fastify();

fastify.register(FastifyHttpProxy, {
  upstream: `http://localhost:3000`,
  constraints: { version: '1.2.0' },
});

fastify.listen();

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

I'm trying to do that right now