mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 21:28:30 +02:00
3.0.1 init commit
- Removed Go HTTP client UA - Added optional bypass of websocket origin check #107 - Added basic forward proxy for debug - Fixed UI error in network utils tab
This commit is contained in:
25
src/mod/forwardproxy/cproxy/default_dialer.go
Normal file
25
src/mod/forwardproxy/cproxy/default_dialer.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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("[INFO] Unable to establish connection to [%s]: %s", address, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user