mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-17 14:09:44 +02:00
improved docker reconnect mechanism, removed redundant checkings, refactor
This commit is contained in:
@@ -156,12 +156,19 @@ func (cfg *AgentConfig) Transport() *http.Transport {
|
||||
if addr != AgentHost+":443" {
|
||||
return nil, &net.AddrError{Err: "invalid address", Addr: addr}
|
||||
}
|
||||
return gphttp.DefaultDialer.DialContext(ctx, network, cfg.Addr)
|
||||
if network != "tcp" {
|
||||
return nil, &net.OpError{Op: "dial", Net: network, Source: nil, Addr: nil}
|
||||
}
|
||||
return cfg.DialContext(ctx)
|
||||
},
|
||||
TLSClientConfig: cfg.tlsConfig,
|
||||
}
|
||||
}
|
||||
|
||||
func (cfg *AgentConfig) DialContext(ctx context.Context) (net.Conn, error) {
|
||||
return gphttp.DefaultDialer.DialContext(ctx, "tcp", cfg.Addr)
|
||||
}
|
||||
|
||||
func (cfg *AgentConfig) Name() string {
|
||||
return cfg.name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user