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

WIP add v2 support. #6

Closed
wants to merge 1 commit into from
Closed

WIP add v2 support. #6

wants to merge 1 commit into from

Conversation

pires
Copy link

@pires pires commented Aug 27, 2016

This is a work-in-progress - more of a proof-of-concept, actually - to fix #5.

I'm very interested in getting feedback about my library implementation and hope that eventually, with your guidance and help, we'll have this merged.

@@ -80,9 +69,14 @@ func NewConn(conn net.Conn, timeout time.Duration) *Conn {
// it is returned and the socket is closed.
func (p *Conn) Read(b []byte) (int, error) {
var err error
p.once.Do(func() { err = p.checkPrefix() })
p.once.Do(func() { err = p.checkHeader() })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your changes so far. Would this violates the spec? http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt

The receiver MUST be configured to only receive the protocol described in this
specification and MUST not try to guess whether the protocol header is present
or not. This means that the protocol explicitly prevents port sharing between
public and private access. Otherwise it would open a major security breach by
allowing untrusted parties to spoof their connection addresses. The receiver
SHOULD ensure proper access filtering so that only trusted proxies are allowed
to use this protocol.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@pires
Copy link
Author

pires commented Jan 21, 2017

Meanwhile, I've made an implementation of my own available, https://github.com/pires/go-proxyproto.

@vgiralt
Copy link

vgiralt commented Jan 6, 2020

Any hope for this to go further? Do you need any help? This would be very useful for projects we have that are written in Go and use client certificates.

@pires
Copy link
Author

pires commented Jan 28, 2021

Closing this as the alternative implementation supports v2, TLS and more.

@pires pires closed this Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support v2
3 participants