proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package proxy implements version 2 of the PROXY protocol (https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListener

func NewListener(inner net.Listener) net.Listener

NewListener creates a net.Listener which accepts connections from an inner net.Listener, reads the PROXY v2 header from the client, and sets the local and remote addresses of the net.Conn to the values specified in the PROXY header.

Types

type Header struct {
	RemoteAddr net.Addr
	LocalAddr  net.Addr
}

Header represents a PROXY protocol header

func ReadHeader

func ReadHeader(conn net.Conn) (*Header, error)

Read the PROXY protocol header from conn

func (Header) Format

func (header Header) Format() []byte

Return the wire representation of header

Jump to

Keyboard shortcuts

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