httpwrapper

package
v0.0.0-...-8ac4b46 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpHandler

type HttpHandler struct {
	Handler http.Handler
	Logger  *slog.Logger
}

func (*HttpHandler) ServeHTTP

func (l *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Common entry point for H1, H2 - both plain and tls Will do the 'common' operations - authn, authz, logging, metrics for all BTS and regular HTTP.

Important: When using for BTS we need to work around golang http stack implementation. This should be used as fallback - QUIC and WebRTC have proper mux and TUN support. In particular, while H2 POST and CONNECT allow req/res Body to act as TCP stream, the closing (FIN/RST) are very tricky:

  • ResponseWriter (in BTS server) does not have a 'Close' method, it is closed after the method returns. That means we can't signal the TCP FIN or RST, which breaks some protocols.
  • The request must be fully consumed before the method returns.

Jump to

Keyboard shortcuts

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