sitehttptest

package
v0.2.2-dev.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0 modules, 0 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 sitehttptest checks that an HTTPS site of the node speaks HTTP/2 like every other one. A scanner sees the first SETTINGS and WINDOW_UPDATE frames a server sends, so all sites of a node (Hysteria2, VLESS, TrustTunnel, the bridge's) must send the same: Check opens a connection to a running site and compares them with the ones of sitehttp itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Certificate

func Certificate(t testing.TB) tls.Certificate

Certificate is a throwaway self-signed certificate for a site under test.

func Check

func Check(t testing.TB, site string, conn net.Conn)

Check fails the test when the site behind conn sends other first frames than sitehttp's own.

Types

type Frames

type Frames struct {
	Settings []http2.Setting
	Windows  []uint32
}

Frames are the first SETTINGS and WINDOW_UPDATE frames a server sends on an HTTP/2 connection.

func Handshake

func Handshake(t testing.TB, conn net.Conn) Frames

Handshake runs TLS with ALPN h2 and the HTTP/2 preface over conn (any server name: the check does not verify the certificate) and returns the frames the server sent first. It closes conn.

func Reference

func Reference(t testing.TB) Frames

Reference returns the frames of a bare server configured by sitehttp.ConfigureSiteHTTP2: what every site must send.

Jump to

Keyboard shortcuts

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