mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-25 12:47:31 +00:00
net/netns: move SOCKS dialing to netns for now
This lets control & logs also use SOCKS dials. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
cf0d19f0ab
commit
24009241bf
20
net/netns/socks.go
Normal file
20
net/netns/socks.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// 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.
|
||||
|
||||
// +build !ios
|
||||
|
||||
package netns
|
||||
|
||||
import "golang.org/x/net/proxy"
|
||||
|
||||
func init() {
|
||||
wrapDialer = wrapSocks
|
||||
}
|
||||
|
||||
func wrapSocks(d Dialer) Dialer {
|
||||
if cd, ok := proxy.FromEnvironmentUsing(d).(Dialer); ok {
|
||||
return cd
|
||||
}
|
||||
return d
|
||||
}
|
Reference in New Issue
Block a user