mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-03 11:31:12 +02:00
Saves 139 KB. Also Synology support, which I saw had its own large-ish proxy parsing support on Linux, but support for proxies without Synology proxy support is reasonable, so I pulled that out as its own thing. Updates #12614 Change-Id: I22de285a3def7be77fdcf23e2bec7c83c9655593 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
26 lines
484 B
Go
26 lines
484 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build linux
|
|
|
|
package tshttpproxy
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
|
|
"tailscale.com/feature/buildfeatures"
|
|
"tailscale.com/version/distro"
|
|
)
|
|
|
|
func init() {
|
|
sysProxyFromEnv = linuxSysProxyFromEnv
|
|
}
|
|
|
|
func linuxSysProxyFromEnv(req *http.Request) (*url.URL, error) {
|
|
if buildfeatures.HasSynology && distro.Get() == distro.Synology {
|
|
return synologyProxyFromConfigCached(req)
|
|
}
|
|
return nil, nil
|
|
}
|