summaryrefslogtreecommitdiffhomepage
path: root/net/tshttpproxy/tshttpproxy.go
AgeCommit message (Collapse)AuthorFilesLines
2025-08-15net/tshttpproxy: use errors.New for error creation (#16860)Will Hannah1-1/+2
Updates tailscale/corp#30668 Signed-off-by: Will Hannah <willh@tailscale.com>
2025-08-14net/tshttpproxy: add macOS support for system proxy (#16826)Will Hannah1-0/+17
Adds a setter for proxyFunc to allow macOS to pull defined system proxies. Disallows overriding if proxyFunc is set via config. Updates tailscale/corp#30668 Signed-off-by: Will Hannah <willh@tailscale.com>
2024-02-22net/tshttpproxy: log when we're using a proxyAndrew Dunham1-1/+25
Updates #11196 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Id6334c10f52f4cfbda9f03dc8096ab7a6c54a088
2023-03-29net/tshttpproxy: don't proxy through ourselvesAndrew Dunham1-2/+76
When running a SOCKS or HTTP proxy, configure the tshttpproxy package to drop those addresses from any HTTP_PROXY or HTTPS_PROXY environment variables. Fixes #7407 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I6cd7cad7a609c639780484bad521c7514841764b
2023-02-03net/tshttpproxy: more directly use Transport proxy CONNECT hooksMihai Parparita1-7/+24
GetProxyConnectHeader (golang/go#41048) was upstreamed in Go 1.16 and OnProxyConnectResponse (golang/go#54299) in Go 1.20, thus we no longer need to guard their use by the tailscale_go build tag. Updates #7123 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-11-14net/tshttpproxy: don't ignore env-based HTTP proxies after system lookups failBrad Fitzpatrick1-5/+9
There was a mechanism in tshttpproxy to note that a Windows proxy lookup failed and to stop hitting it so often. But that turns out to fire a lot (no PAC file configured at all results in a proxy lookup), so after the first proxy lookup, we were enabling the "omg something's wrong, stop looking up proxies" bit for awhile, which was then also preventing the normal Go environment-based proxy lookups from working. This at least fixes environment-based proxies. Plenty of other Windows-specific proxy work remains (using WinHttpGetIEProxyConfigForCurrentUser instead of just PAC files, ignoring certain types of errors, etc), but this should fix the regression reported in #4811. Updates #4811 Change-Id: I665e1891897d58e290163bda5ca51a22a017c5f9 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-09-29all: fix spelling mistakesJosh Soref1-1/+1
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2021-02-18net/tshttpproxy: support HTTP proxy environment credentials on Windows tooBrad Fitzpatrick1-5/+3
and some minor style nits. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-02-17net/tshttpproxy: support basic auth when available (#1354)Christine Dodrill1-0/+12
This allows proxy URLs such as: http://azurediamond:hunter2@192.168.122.154:38274 to be used in order to dial out to control, logs or derp servers. Signed-off-by: Christine Dodrill <xe@tailscale.com>
2020-09-21net/tshttpproxy: appease staticcheckBrad Fitzpatrick1-0/+2
2020-09-21net/tshttpproxy: add GetProxyForURL negative cacheBrad Fitzpatrick1-0/+29
Otherwise when PAC server is down, we log, and each log entry is a new HTTP request (from logtail) and a new GetProxyForURL call, which again logs, non-stop. This is also nicer to the WinHTTP service. Then also hook up link change notifications to the cache to reset it if there's a chance the network might work sooner.
2020-08-27net/tshttpproxy: move the TS_DEBUG_FAKE_PROXY_AUTH knob up a levelBrad Fitzpatrick1-0/+4
2020-08-26tshttpproxy, controlclient, derphttp, logpolicy: send Negotiate auth to proxiesBrad Fitzpatrick1-0/+13
For Windows only, and only when built with Tailscale's Go tree. Updates tailscale/corp#583
2020-08-25net/tshttpproxy: add start of Kerberos Negotiate auth to proxies on WindowsBrad Fitzpatrick1-0/+10
For now only used by a new cmd/tailscale debug --get-url subcommand. Not yet wired up to the places making HTTP requests. Updates tailscale/corp#583
2020-08-18net/tshttpproxy: new package, support WPAD/PAC proxies on WindowsBrad Fitzpatrick1-0/+33
Updates tailscale/corp#553 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>