This commit enables user to set service backend to remote destinations, that can be a partial
URL or a full URL. The commit also prevents user to set remote destinations on linux system
when socket mark is not working. For user on any version of mac extension they can't serve a
service either. The socket mark usability is determined by a new local api.
Fixestailscale/corp#24783
Signed-off-by: KevinLiang10 <37811973+KevinLiang10@users.noreply.github.com>
msgDisableServiceProxy="To disable the proxy, run: tailscale serve --service=%s --%s=%d off"
msgDisableServiceTun="To disable the service in TUN mode, run: tailscale serve --service=%s --tun off"
msgDisableService="To remove config for the service, run: tailscale serve clear %s"
msgWarnRemoteDestCompatibility="Warning: %s doesn't support connecting to remote destinations from non-default route, see tailscale.com/kb/1552/tailscale-services for detail."
msgToExit="Press Ctrl+C to exit."
)
@ -1134,6 +1140,77 @@ func (e *serveEnv) messageForPort(sc *ipn.ServeConfig, st *ipnstate.Status, dnsN
returnoutput.String()
}
// isRemote reports whether the given destination from serve config
// is a remote destination.
funcisRemote(targetstring)bool{
// target being a port number means it's localhost