pires / go-proxyproto

A Go library implementation of the PROXY protocol, versions 1 and 2.
Apache License 2.0
492 stars 108 forks source link

Convenient way (example) how to use tlvparse functions with proxyproto.Conn #26

Closed timson closed 4 years ago

timson commented 4 years ago

I have question about way to use tlvparse subpackage. I need to use SSL functions from tlvparse package to fetch SSL related info from header. It takes []proxyproto.TLV as argument, so my question is what the right way to get []proxyproto.TLV from proxyproto.Conn struct? My problem is that header field unexported in proxyproto.Conn struct and I can not access it from my app. May be I do something wrong, or misunderstand something, any idea, comments, suggestion? Thanks!

pires commented 4 years ago

Sorry, I totally missed this. I think you're right and you won't be able to do it without forking the library and implementing custom code. Since you're closing the issue, did you find a solution?

timson commented 4 years ago

No problem at all ) Yes, I did exactly what you said, I forked library and implement custom Header function on proxyproto.Conn to get header, and it was enough for me, after that I got tlvs and able to parse it. Thanks!