mirror of https://github.com/portainer/portainer
21 lines
470 B
Go
21 lines
470 B
Go
package factory
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
"github.com/portainer/portainer/api/http/proxy/factory/azure"
|
|
)
|
|
|
|
func newAzureProxy(endpoint *portainer.Endpoint) (http.Handler, error) {
|
|
remoteURL, err := url.Parse(azureAPIBaseURL)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
proxy := newSingleHostReverseProxyWithHostHeader(remoteURL)
|
|
proxy.Transport = azure.NewTransport(&endpoint.AzureCredentials)
|
|
return proxy, nil
|
|
}
|