Skip to content

Proxy to old API for selected new endpoints #2237

Answered by Tratcher
mskorb asked this question in General
Discussion options

You must be logged in to vote

You can switch to a middleware approach instead:

using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Yarp.ReverseProxy.Forwarder;

namespace CustomForwarding
{
    public class CustomForwardingMiddleware
    {
	private readonly RequestDelegate _next;
        private readonly IHttpForwarder _forwarder;
        private readonly HttpMessageInvoker _client;
        private readonly string _destination = "ULR Prefix To Forward To";

        public CustomForwardingMiddleware(RequestDelegate next, IHttpForwarder forwarder)
	{
	    _next = next;
            _forwarder = forwarder;
            // https://github.com/microsoft/reverse-proxy/blob/47f1e7c21d6a3a5771d6177…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by karelz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants