GitXplorerGitXplorer
m

proxyprotocol

public
13 stars
7 forks
2 issues

Commits

List of commits on branch master.
Unverified
ab99c61acf16026043e36f5d4d862596386a0372

fix issue with v4-mapped IPv6 addresses

mmastercactapus committed 2 years ago
Unverified
ae65f2ce73c948fdd0d8f00ffaa6c519373c38bf

update WriteTo to make a single .Write call

mmastercactapus committed 4 years ago
Unverified
33bfbddd3395c4ebe592b09fb81a2b3cb028d195

min Go version 1.13

mmastercactapus committed 4 years ago
Unverified
a4607efab7cef8781a9a1c6024f8a063446d37da

bugfix: handle no timeout with no filter

mmastercactapus committed 4 years ago
Unverified
3f56883f58cf2ca707ff4fd8f72dafeff92dc1f5

add proxy-get command for testing

mmastercactapus committed 4 years ago
Unverified
5c4a101121fc3e868026189c7a73f7f19eef90ac

Add test and fix for malformed/truncated header

mmastercactapus committed 5 years ago

README

The README file for this repository.

proxyprotocol

GoDoc Build Status

This package provides PROXY protocol support for versions 1 and 2.

https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

Features:

  • Auto detect both V1 and V2
  • Client & Server usage support
  • Listener with optional subnet filtering (for TCP/UDP listeners)

Installation

Installable via go get

go get -u github.com/mastercactapus/proxyprotocol

Usage

// Create any net.Listener
l, err := net.Listen("tcp", ":0")
l, err := net.Listen("udp", ":0")
l, err := net.Listen("unix", "/tmp/example")
l, err := net.Listen("unixgram", "/tmp/example")

// Wrap it to have RemoteAddr() and LocalAddr() resolved for all new connections
l = proxyprotocol.NewListener(l, 0)

c, err : = l.Accept()

c.RemoteAddr() // = The PROXY header source address
c.LocalAddr()  // = The PROXY header destination address