modulepackage
0.0.0-unstable.1
Repository: https://github.com/go-faster/hx.git
Documentation: pkg.go.dev
# README
hx

Work in progress.
Simplified and reworked fork of fasthttp.
Intended to serve plaintext HTTP 1.1 behind load balancer and reverse-pory in controlled environment.
Fully buffer request or response.
Non-goals
- Client
- Load balancing
- WebSocket
- Streaming, like io.Reader or io.Writer
- Forms
- File
- HTTP 2.0, 3.0, QUIC
- TLS
- Running without reverse proxy
# Functions
AcquireArgs returns an empty Args object from the pool.
AcquireCookie returns an empty Cookie object from the pool.
AcquireURI returns an empty URI instance from the pool.
AppendHTMLEscape appends html-escaped s to dst and returns the extended dst.
AppendHTMLEscapeBytes appends html-escaped s to dst and returns the extended dst.
AppendHTTPDate appends HTTP-compliant (RFC1123) representation of date to dst and returns the extended dst.
AppendIPv4 appends string representation of the given ip v4 to dst and returns the extended dst.
AppendNormalizedHeaderKey appends normalized header key (name) to dst and returns the resulting dst.
AppendNormalizedHeaderKeyBytes appends normalized header key (name) to dst and returns the resulting dst.
AppendQuotedArg appends url-encoded src to dst and returns appended dst.
AppendUint appends n to dst and returns the extended dst.
AppendUnquotedArg appends url-decoded src to dst and returns appended dst.
ListenAndServe serves HTTP requests from the given TCP addr using the given handler.
ParseHTTPDate parses HTTP-compliant (RFC1123) date.
ParseIPv4 parses ip address from ipStr into dst and returns the extended dst.
ParseUfloat parses unsigned float from buf.
ParseUint parses uint from buf.
ReleaseArgs returns the object acquired via AcquireArgs to the pool.
ReleaseCookie returns the Cookie object acquired with AcquireCookie back to the pool.
ReleaseURI releases the URI acquired via AcquireURI.
Serve serves incoming connections from the given listener using the given handler.
ServeConn serves HTTP requests from the given connection using the given handler.
StatusMessage returns HTTP status message for the given status code.
# Constants
CookieSameSiteDefaultMode sets the SameSite flag.
CookieSameSiteDisabled removes the SameSite flag.
CookieSameSiteLaxMode sets the SameSite flag with the "Lax" parameter.
CookieSameSiteNoneMode sets the SameSite flag with the "None" parameter see https://tools.ietf.org/html/draft-west-cookie-incrementalism-00.
CookieSameSiteStrictMode sets the SameSite flag with the "Strict" parameter.
DefaultWorkers is the maximum number of concurrent connections the Server may serve by default (i.e.
Content negotiation.
Client hints.
Headers.
Headers.
Headers.
Headers.
Other.
Headers.
Range requests.
Headers.
CORS.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Caching.
Response context.
Headers.
Authentication.
Headers.
Headers.
Connection management.
Downloads.
Headers.
Message body information.
Headers.
Headers.
Headers.
Headers.
Security.
Headers.
Headers.
Controls.
Headers.
Headers.
Do Not Track.
Headers.
Headers.
Conditionals.
Headers.
Headers.
Headers.
Headers.
Proxies.
Request context.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Server-sent event.
Headers.
Headers.
Redirects.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
WebSockets.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Transfer coding.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
Headers.
RFC 7231, 4.3.6.
RFC 7231, 4.3.5.
RFC 7231, 4.3.1.
RFC 7231, 4.3.2.
RFC 7231, 4.3.7.
RFC 5789.
RFC 7231, 4.3.3.
RFC 7231, 4.3.4.
RFC 7231, 4.3.8.
Race reports if the race detector is enabled.
StateActive represents a connection that has read 1 or more bytes of a request.
StateClosed represents a closed connection.
StateIdle represents a connection that has finished handling a request and is in the keep-alive state, waiting for a new request.
StateNew represents a new connection that is expected to send a request immediately.
RFC 7231, 6.3.3.
RFC 5842, 7.1.
RFC 7231, 6.6.3.
RFC 7231, 6.5.1.
RFC 7231, 6.5.8.
RFC 7231, 6.2.1.
RFC 7231, 6.3.2.
RFC 8297.
RFC 7231, 6.5.14.
RFC 4918, 11.4.
RFC 7231, 6.5.3.
RFC 7231, 6.4.3.
RFC 7231, 6.6.5.
RFC 7231, 6.5.9.
RFC 7231, 6.6.6.
RFC 3229, 10.4.1.
RFC 4918, 11.5.
RFC 7231, 6.6.1.
RFC 7231, 6.5.10.
RFC 4918, 11.3.
RFC 5842, 7.2.
RFC 7231, 6.5.5.
RFC 7540, 9.1.2.
RFC 7231, 6.4.2.
RFC 7231, 6.4.1.
RFC 4918, 11.1.
RFC 6585, 6.
RFC 7231, 6.3.5.
RFC 7231, 6.3.4.
RFC 7231, 6.5.6.
RFC 2774, 7.
RFC 7231, 6.5.4.
RFC 7231, 6.6.2.
RFC 7232, 4.1.
RFC 7231, 6.3.1.
RFC 7233, 4.1.
RFC 7231, 6.5.2.
RFC 7538, 3.
RFC 7232, 4.2.
RFC 6585, 3.
RFC 2518, 10.1.
RFC 7235, 3.2.
RFC 7233, 4.4.
RFC 7231, 6.5.11.
RFC 6585, 5.
RFC 7231, 6.5.7.
RFC 7231, 6.5.12.
RFC 7231, 6.3.6.
RFC 7231, 6.4.4.
RFC 7231, 6.6.4.
RFC 7231, 6.2.2.
RFC 7168, 2.3.3.
RFC 7231, 6.4.7.
RFC 6585, 4.
RFC 7235, 3.1.
RFC 7725, 3.
RFC 4918, 11.2.
RFC 7231, 6.5.13.
RFC 7231, 6.5.15.
RFC 7231, 6.4.5.
RFC 2295, 8.1.
# Variables
CookieExpireDelete may be set on Cookie.Expire for expiring the given cookie.
CookieExpireUnlimited indicates that the cookie doesn't expire.
ErrBodyTooLarge is returned if either request or response body exceeds the given limit.
ErrNoArgValue is returned when Args value with the given key is missing.
No description provided by the author
No description provided by the author
# Structs
Args represents query arguments.
Buffer is bytes.Buffer.
Cookie represents HTTP response cookie.
Ctx contains incoming request and manages outgoing response.
ErrBrokenChunk is returned when server receives a broken chunked body (Transfer-Encoding: chunked).
ErrNothingRead is returned when a keep-alive connection is closed, either because the remote closed it or because of a read timeout.
ErrSmallBuffer is returned when the provided buffer size is too small for reading request and/or response headers.
Request represents HTTP request.
RequestConfig configure the per request deadline and body limits.
RequestHeader represents HTTP request header.
Response represents HTTP response.
ResponseHeader represents HTTP response header.
Server implements HTTP server.
URI represents URI :) .
# Type aliases
A ConnState represents the state of a client connection to a server.
CookieSameSite is an enum for the mode in which the SameSite flag should be set for the given cookie.
No description provided by the author
Handler must process incoming requests.
No description provided by the author
ServeHandler must process tls.Config.NextProto negotiated requests.