13 Commits

Author SHA1 Message Date
Dolf Schimmel
4f007d811a Make LocalAddr return the original Local Address, remove DstAddr() 2017-04-23 18:14:14 +02:00
Dolf Schimmel
179173093a Merge branch 'expose-dstaddr' of https://github.com/weaveworks/go-proxyproto into HEAD 2017-04-23 18:13:37 +02:00
Dolf Schimmel
a7d188e20b Merge branch 'master' of https://github.com/armon/go-proxyproto into HEAD 2017-04-23 16:46:58 +02:00
Tom Wilkie
50b4985199 Add a method to expose the proxy protocol destination address. 2017-02-15 19:22:02 +00:00
Armon Dadgar
3daa90aec0 Merge pull request #4 from keymon/non_blocking_remote_addr
Add a timeout to RemoteAddr() to allow http.Serve in go < 1.6 work
2016-07-18 16:16:24 -07:00
Hector Rivas Gandara
efc48d41bc Fix Close connection for invalid header
RemoteAddr() must close the connection and clear the buffer if we
receive a invalid PROXY protocol header.

Change the client test as it can get an EOF or a ECONNRESET.
2016-07-13 16:37:20 +01:00
Hector Rivas Gandara
49fdb5cfab Add optional timeout to get PROXY header
The library user can define a maximum time to wait
for the PROXY protocol header, before failing out to
normal connection.

We can assume that a proxy in front of the service will
send the PROXY header immediatelly.

This solves the issue of clients getting block when
getting the RemoteAddr() for an incoming connection that
does not send any data. That is the case of http.Serve on
go < 1.6 as described in https://github.com/armon/go-proxyproto/issues/1
2016-07-13 16:37:20 +01:00
Dolf Schimmel (Freeaqingme)
673e5fd897 Actually close connection upon prefix error 2016-03-27 19:47:29 +02:00
Dolf Schimmel (Freeaqingme)
5debf2cd3c Error on invalid proxyprotocol prefix 2016-03-27 19:06:36 +02:00
Armon Dadgar
609d6338d3 Don't log EOF 2015-02-06 18:58:55 -08:00
Armon Dadgar
539ffadba7 Improve documentation 2014-03-07 16:50:31 -08:00
Armon Dadgar
4e433eb4da Initial commit 2014-03-07 16:45:16 -08:00
Armon Dadgar
debe0b5149 Initial commit 2014-03-07 16:43:47 -08:00