server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HybridListener

type HybridListener struct {
	net.Listener
	// contains filtered or unexported fields
}

HybridListener inspects the first bytes of the connection to determine whether to serve unencrypted HTTP or TLS. This allows using the same TCP port for both, which is convenient to reduce the configuration burden on the user. Source: https://github.com/foreverzmy/http-s-listen-same-port/

func (*HybridListener) Accept

func (ln *HybridListener) Accept() (net.Conn, error)

type PeekConn

type PeekConn struct {
	net.Conn
	// contains filtered or unexported fields
}

PeekConn is a buffered Conn for peeking into the connection.

func (*PeekConn) Peek

func (c *PeekConn) Peek(n int) ([]byte, error)

func (*PeekConn) Read

func (c *PeekConn) Read(b []byte) (int, error)

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server is a wrapper around http.Server with some custom behavior.

func New

func New(appCtx *actx.Context, addr string) (*Server, error)

New returns a new web Server instance. It creates a self-signed certificate for TLS connections over which store data will be transferred.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe is a replacement of http.ListenAndServe to ensure we set the correct server address to be used in URLs, templates, etc. This is needed when starting the server with address ':0'.

Directories

Path Synopsis
api
v1

Jump to

Keyboard shortcuts

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