Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a timeout to RemoteAddr() to allow http.Serve in go < 1.6 work #4

Merged
merged 2 commits into from
Jul 18, 2016

Commits on Jul 13, 2016

  1. 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 armon#1
    keymon committed Jul 13, 2016
    Configuration menu
    Copy the full SHA
    49fdb5c View commit details
    Browse the repository at this point in the history
  2. 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.
    keymon committed Jul 13, 2016
    Configuration menu
    Copy the full SHA
    efc48d4 View commit details
    Browse the repository at this point in the history