feat(netxlite): implement hooks for transparent proxy (#561)
See https://github.com/ooni/probe/issues/1803#issuecomment-957323297.
This commit is contained in:
parent
eaa3d6eae0
commit
ffdafaf351
5 changed files with 65 additions and 6 deletions
|
|
@ -85,12 +85,12 @@ var _ Dialer = &dialerSystem{}
|
|||
|
||||
const dialerDefaultTimeout = 15 * time.Second
|
||||
|
||||
func (d *dialerSystem) newUnderlyingDialer() *net.Dialer {
|
||||
func (d *dialerSystem) newUnderlyingDialer() TProxyDialer {
|
||||
t := d.timeout
|
||||
if t <= 0 {
|
||||
t = dialerDefaultTimeout
|
||||
}
|
||||
return &net.Dialer{Timeout: t}
|
||||
return TProxy.NewTProxyDialer(t)
|
||||
}
|
||||
|
||||
func (d *dialerSystem) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue