2018-07-23 14:49:04 +00:00
|
|
|
// +build !windows
|
2018-07-20 09:02:06 +00:00
|
|
|
|
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
2019-05-24 06:04:58 +00:00
|
|
|
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
2018-07-20 09:02:06 +00:00
|
|
|
)
|
|
|
|
|
2019-05-24 06:04:58 +00:00
|
|
|
func (factory *proxyFactory) newLocalProxy(path string, endpointID portainer.EndpointID) http.Handler {
|
2018-07-20 09:02:06 +00:00
|
|
|
proxy := &localProxy{}
|
|
|
|
transport := &proxyTransport{
|
|
|
|
enableSignature: false,
|
|
|
|
ResourceControlService: factory.ResourceControlService,
|
|
|
|
TeamMembershipService: factory.TeamMembershipService,
|
|
|
|
SettingsService: factory.SettingsService,
|
|
|
|
RegistryService: factory.RegistryService,
|
|
|
|
DockerHubService: factory.DockerHubService,
|
|
|
|
dockerTransport: newSocketTransport(path),
|
2019-05-24 06:04:58 +00:00
|
|
|
endpointIdentifier: endpointID,
|
2018-07-20 09:02:06 +00:00
|
|
|
}
|
|
|
|
proxy.Transport = transport
|
|
|
|
return proxy
|
|
|
|
}
|