2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-05-14 06:35:17 +01:00
|
|
|
|
2022-06-06 21:52:52 +01:00
|
|
|
//go:build !ios && !js
|
2020-05-14 06:35:17 +01:00
|
|
|
|
2020-06-01 18:50:37 +01:00
|
|
|
package netns
|
2020-05-14 06:35:17 +01:00
|
|
|
|
|
|
|
import "golang.org/x/net/proxy"
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
wrapDialer = wrapSocks
|
|
|
|
}
|
|
|
|
|
2020-06-01 18:50:37 +01:00
|
|
|
func wrapSocks(d Dialer) Dialer {
|
|
|
|
if cd, ok := proxy.FromEnvironmentUsing(d).(Dialer); ok {
|
2020-05-14 06:35:17 +01:00
|
|
|
return cd
|
|
|
|
}
|
|
|
|
return d
|
|
|
|
}
|