summaryrefslogtreecommitdiffhomepage
path: root/ipn
diff options
context:
space:
mode:
authorMarwan Sulaiman <marwan@tailscale.com>2023-08-29 15:05:30 +0100
committerMarwan Sulaiman <marwan@tailscale.com>2023-08-29 15:18:36 +0100
commitdea35a2f389576830575843109eeb75b7d9a8e0a (patch)
treed09a1d13eedb7ee4ef3c5eec3025663e9517c271 /ipn
parent8ba07aac854e45dee24242736af857bc10216ceb (diff)
downloadtailscale-marwan/servedev.tar.xz
tailscale-marwan/servedev.zip
cmd/tailscale: combine funnel and serve under dev flagmarwan/servedev
This PR combines the funnel and serve code under the same path. However, it is using the new code which means features being added to the funnel command will automatically be added to serve but also things that are missing are missing from both. Updates #8489 Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
Diffstat (limited to 'ipn')
-rw-r--r--ipn/ipnlocal/serve.go8
-rw-r--r--ipn/serve.go4
2 files changed, 9 insertions, 3 deletions
diff --git a/ipn/ipnlocal/serve.go b/ipn/ipnlocal/serve.go
index de9de77ce..8778548c1 100644
--- a/ipn/ipnlocal/serve.go
+++ b/ipn/ipnlocal/serve.go
@@ -356,10 +356,12 @@ func setHandler(sc *ipn.ServeConfig, req ipn.ServeStreamRequest) {
wsc.Handlers[req.MountPoint] = &ipn.HTTPHandler{
Proxy: req.Source,
}
- if sc.AllowFunnel == nil {
- sc.AllowFunnel = make(map[ipn.HostPort]bool)
+ if req.Funnel {
+ if sc.AllowFunnel == nil {
+ sc.AllowFunnel = make(map[ipn.HostPort]bool)
+ }
+ sc.AllowFunnel[req.HostPort] = true
}
- sc.AllowFunnel[req.HostPort] = true
}
func deleteHandler(sc *ipn.ServeConfig, req ipn.ServeStreamRequest, port uint16) {
diff --git a/ipn/serve.go b/ipn/serve.go
index 3b6034fa9..11df99726 100644
--- a/ipn/serve.go
+++ b/ipn/serve.go
@@ -93,6 +93,10 @@ type ServeStreamRequest struct {
// MountPoint is the path prefix for
// the given HostPort.
MountPoint string `json:",omitempty"`
+
+ // Funnel indicates whether the request
+ // is a serve request or a funnel one.
+ Funnel bool `json:",omitempty"`
}
// FunnelRequestLog is the JSON type written out to io.Writers