server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 5 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(address string, hostHandler *host.HostHandler, timeouts Timeouts) *http.Server

Types

type Timeouts added in v0.5.0

type Timeouts struct {
	ReadHeaderTimeout time.Duration
	ReadTimeout       time.Duration
	WriteTimeout      time.Duration
	IdleTimeout       time.Duration
	// StreamStallTimeout is NOT an http.Server field. It is the separate,
	// much larger sliding window a text/event-stream response runs on, so
	// SSE is bounded on its own terms rather than by WriteTimeout (which
	// is cadence-sized and severed real streams — #167) or by nothing at
	// all (which left a stalled consumer holding the connection until TCP
	// keepalive, ~2h11m). See middleware.WithStreamDeadline.
	StreamStallTimeout time.Duration
}

Timeouts bounds exposure on every accepted connection. Zero in any field means "no timeout" (the stdlib default) — a single slow client can then hold a goroutine + FD indefinitely (Slowloris). See kdex-tech/host-manager#49 for why they exist and #167 for why they are configurable.

func DefaultTimeouts added in v0.5.0

func DefaultTimeouts() Timeouts

DefaultTimeouts is the conservative pairing shipped since #49. The proxy round-trip path already tolerates 60s cold starts via its own ResponseHeaderTimeout, so 60s read/write matches it.

StreamStallTimeout is 5m: 20x the 15s keep-alive cadence of the SSE backends #167 was reported against, so a healthy stream is effectively unbounded, while a stalled one is reclaimed in minutes instead of hours.

Jump to

Keyboard shortcuts

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