2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-04-19 23:33:29 +01:00
|
|
|
|
|
|
|
//go:build linux
|
|
|
|
|
|
|
|
package tshttpproxy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"tailscale.com/version/distro"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
sysProxyFromEnv = linuxSysProxyFromEnv
|
|
|
|
}
|
|
|
|
|
|
|
|
func linuxSysProxyFromEnv(req *http.Request) (*url.URL, error) {
|
|
|
|
if distro.Get() == distro.Synology {
|
|
|
|
return synologyProxyFromConfigCached(req)
|
|
|
|
}
|
|
|
|
return nil, nil
|
|
|
|
}
|