Proxy another api in 30 seconds from configuration.
AutoProxy is a drop-in microservice for proxying another api from configuration with headers forwarding, auth, cors, impersonation and more...
You can also use AutoProxy as a middleware in your aspnet core app.
Choose between middleware or microservice
Install-Package AutoProxy.AspNetCore
Download the last release, drop it to your server and that's it!
All the configuration can be made in environment variable or appsettings.json file
Just add simple json or environment based configuration like this:
"AutoProxy": {
"Path": "proxy",
"Proxies": [
{
"Name": "DuckDuck", // Required
"BaseUrl": "https://duckduckgo.com/", // Required
"Path": "proxy1",
"WhiteList": "https://duckduckgo.com/api/(.*)", // Regex capable
"Auth": {
"Type": "Ntlm", // (Ntlm, Bearer or BasicToNtlm)
"UseImpersonation": false,
"User": "Jhon",
"Password": "Doe",
"Domain": "DoeCorp",
"LogPassword": true // To log password with serilog
},
"Headers": {
"Remove": [ "Origin", "Host" ],
"Replace": [
{
"Key": "Host",
"Value": "duckduckgo.com"
}
]
}
}
]
}
You can add multiple proxies with different path, the path for the first proxy is not required.
"Cors": {
"Enabled": true, // default is false
"Methods": "...", // default is *
"Origins": "...", // default is *
"Headers": "...", // default is *
}
Currently only chose to use IIS integration
"Host": {
"UseIis": true
}
Kestrel options, see ms doc for usage
"Kestrel": {
"AddServerHeader": false
}
storfiler use Serilog for logging, see serilog-settings-configuration for usage
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{ "Name": "Console" }
],
"Enrich": ["FromLogContext"]
}