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 p1_proxy_protocol module #13

Merged
merged 2 commits into from Dec 10, 2021
Merged

Conversation

weiss
Copy link
Member

@weiss weiss commented Dec 10, 2021

Import the p1_proxy_protocol module (which decodes HAproxy protocol (v1 and v2) headers) from ejabberd to make it reusable by other applications (I'd like to use it in stun). Once it's included with p1_utils, ejabberd could be updated to use it from there.

The p1_proxy_protocol module decodes HAproxy protocol (v1 and v2)
headers.
@prefiks
Copy link
Member

prefiks commented Dec 10, 2021

Looks ok, maybe just we could define -spec for decode (gen_tcp | ssl, inet:socket(), integer()) -> {error, atom()} | {{inet:ip_address(), inet:port_number()}, {inet:ip_address(), inet:port_number()}} | {undefined, undefined}

Add a function specification for p1_proxy_protocol:decode/3 (thanks to
Paweł Chmielowski) and adjust the file header comments and license text
(thanks to Marcus Rückert).
@weiss
Copy link
Member Author

weiss commented Dec 10, 2021

I pushed another commit which adds the function spec and also changes the license text from GPL to Apache 2.

@prefiks prefiks merged commit 55644b7 into processone:master Dec 10, 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.

None yet

2 participants