mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-06 07:37:21 +02:00

- Replaced all log.Println in acme module to system wide logger - Fixed file manager path escape bug #274
26 lines
507 B
Go
26 lines
507 B
Go
package cproxy
|
|
|
|
import (
|
|
"net"
|
|
"time"
|
|
)
|
|
|
|
type defaultDialer struct {
|
|
timeout time.Duration
|
|
logger logger
|
|
}
|
|
|
|
func newDialer(config *configuration) *defaultDialer {
|
|
return &defaultDialer{timeout: config.DialTimeout, logger: config.Logger}
|
|
}
|
|
|
|
func (this *defaultDialer) Dial(address string) Socket {
|
|
if socket, err := net.DialTimeout("tcp", address, this.timeout); err == nil {
|
|
return socket
|
|
} else {
|
|
this.logger.Printf("Unable to establish connection to [%s]: %s", address, err)
|
|
}
|
|
|
|
return nil
|
|
}
|