controlhttp

package
v1.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package controlhttp implements the Tailscale 2021 control protocol base transport over HTTP.

This tunnels the protocol in control/controlbase over HTTP with a variety of compatibility fallbacks for handling picky or deep inspecting proxies.

In the happy path, a client makes a single cleartext HTTP request to the server, the server responds with 101 Switching Protocols, and the control base protocol takes place over plain TCP.

In the compatibility path, the client does the above over HTTPS, resulting in double encryption (once for the control transport, and once for the outer TLS layer).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptHTTP

AcceptHTTP upgrades the HTTP request given by w and r into a Tailscale control protocol base transport connection.

AcceptHTTP always writes an HTTP response to w. The caller must not attempt their own response after calling AcceptHTTP.

func Dial

func Dial(ctx context.Context, addr string, machineKey key.MachinePrivate, controlKey key.MachinePublic, protocolVersion uint16, dialer dnscache.DialContextFunc) (*controlbase.Conn, error)

Dial connects to the HTTP server at addr, requests to switch to the Tailscale control protocol, and returns an established control protocol connection.

If Dial fails to connect using addr, it also tries to tunnel over TLS to <addr's host>:443 as a compatibility fallback.

The provided ctx is only used for the initial connection, until Dial returns. It does not affect the connection once established.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL