• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.gitignoreH A D23-Mar-202110

LICENSEH A D23-Mar-20211.1 KiB

README.mdH A D23-Mar-20211.2 KiB

protocol.goH A D23-Mar-20217.2 KiB

protocol_test.goH A D23-Mar-20219.8 KiB

README.md

1# proxyproto
2
3This library provides the `proxyproto` package which can be used for servers
4listening behind HAProxy of Amazon ELB load balancers. Those load balancers
5support the use of a proxy protocol (http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt),
6which provides a simple mechansim for the server to get the address of the client
7instead of the load balancer.
8
9This library provides both a net.Listener and net.Conn implementation that
10can be used to handle situation in which you may be using the proxy protocol.
11Only proxy protocol version 1, the human-readable form, is understood.
12
13The only caveat is that we check for the "PROXY " prefix to determine if the protocol
14is being used. If that string may occur as part of your input, then it is ambiguous
15if the protocol is being used and you may have problems.
16
17# Documentation
18
19Full documentation can be found [here](http://godoc.org/github.com/armon/go-proxyproto).
20
21# Examples
22
23Using the library is very simple:
24
25```
26
27// Create a listener
28list, err := net.Listen("tcp", "...")
29
30// Wrap listener in a proxyproto listener
31proxyList := &proxyproto.Listener{Listener: list}
32conn, err :=proxyList.Accept()
33
34...
35```
36
37