Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 940 Bytes

File metadata and controls

22 lines (16 loc) · 940 Bytes

bUtility.ReverseProxy

Reverse Proxy utility

###Initialization
Creates a reverse proxy that routes requests from source url to target url using HttpClient.
The HttpClient must have been preconfigured from the calling app.

webApiDestinationUrl => source url
webApiDestinationUrl => destination url
client => the HttpClient
requestMessage.PrepareProxyRequest() => function that adds header(s) to the request (e.g. authentication headers, custom headers e.t.c..)

var proxy = new ReverseProxyHandler(webApiSourceUrl, webApiDestinationUrl,
                client,
                requestMessage => requestMessage.PrepareProxyRequest(),
                (response) => { }, Logger);