socks.go 316 B

12345678910111213141516171819
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. //go:build !ios && !js
  4. package netns
  5. import "golang.org/x/net/proxy"
  6. func init() {
  7. wrapDialer = wrapSocks
  8. }
  9. func wrapSocks(d Dialer) Dialer {
  10. if cd, ok := proxy.FromEnvironmentUsing(d).(Dialer); ok {
  11. return cd
  12. }
  13. return d
  14. }