go-proxyproto

Golang package to handle HAProxy Proxy Protocol

  • Owner: armon/go-proxyproto
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

proxyproto

This library provides the proxyproto package which can be used for servers
listening behind HAProxy of Amazon ELB load balancers. Those load balancers
support the use of a proxy protocol (http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt),
which provides a simple mechansim for the server to get the address of the client
instead of the load balancer.

This library provides both a net.Listener and net.Conn implementation that
can be used to handle situation in which you may be using the proxy protocol.
Only proxy protocol version 1, the human-readable form, is understood.

The only caveat is that we check for the "PROXY " prefix to determine if the protocol
is being used. If that string may occur as part of your input, then it is ambiguous
if the protocol is being used and you may have problems.

Documentation

Full documentation can be found here.

Examples

Using the library is very simple:


// Create a listener
list, err := net.Listen("tcp", "...")

// Wrap listener in a proxyproto listener
proxyList := &proxyproto.Listener{Listener: list}
conn, err :=proxyList.Accept()

...

Main metrics

Overview
Name With Ownerarmon/go-proxyproto
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2014-03-08 00:43:46
Pushed At2023-11-06 17:55:38
Last Commit At2023-11-06 12:55:23
Release Count1
Last Release Namev0.1.0 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count199
Watchers Count8
Fork Count53
Commits Count17
Has Issues Enabled
Issues Count5
Issue Open Count1
Pull Requests Count7
Pull Requests Open Count2
Pull Requests Close Count5
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private