2020-05-14 05:35:17 +00:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-08-05 22:42:39 +00:00
|
|
|
//go:build !ios
|
2020-05-14 05:35:17 +00:00
|
|
|
// +build !ios
|
|
|
|
|
2020-06-01 17:50:37 +00:00
|
|
|
package netns
|
2020-05-14 05:35:17 +00:00
|
|
|
|
|
|
|
import "golang.org/x/net/proxy"
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
wrapDialer = wrapSocks
|
|
|
|
}
|
|
|
|
|
2020-06-01 17:50:37 +00:00
|
|
|
func wrapSocks(d Dialer) Dialer {
|
|
|
|
if cd, ok := proxy.FromEnvironmentUsing(d).(Dialer); ok {
|
2020-05-14 05:35:17 +00:00
|
|
|
return cd
|
|
|
|
}
|
|
|
|
return d
|
|
|
|
}
|