controlhttp

package
v1.22.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: BSD-3-Clause Imports: 19 Imported by: 9 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) (*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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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