Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion middleware/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,18 @@ var DefaultProxyConfig = ProxyConfig{
func proxyRaw(t *ProxyTarget, c echo.Context, config ProxyConfig) http.Handler {
var dialFunc func(ctx context.Context, network, addr string) (net.Conn, error)
if transport, ok := config.Transport.(*http.Transport); ok {
if transport.TLSClientConfig != nil {
switch {
case transport.DialTLSContext != nil:
dialFunc = transport.DialTLSContext
case transport.DialContext != nil:
dialFunc = transport.DialContext
case transport.TLSClientConfig != nil:
d := tls.Dialer{
Config: transport.TLSClientConfig,
}
dialFunc = d.DialContext
}

}
if dialFunc == nil {
var d net.Dialer
Expand Down