Merged
Conversation
Confusingly `sock.proto` is not analogous to the PROXY protocol's socket protocol, rather the `sock.type` attribute is. In almost all cases `sock.proto` will be zero as per https://docs.python.org/3/library/socket.html#socket.socket This was resulting in the command `proxyprotocol-server --service localhost:8082 localhost:8080` always injecting a PROXY protocol header with a protocol of int 0 to the downstream server. This PR fixes that, it now correctly injects int 1 in the above scenario and the other `SocketKind` lookups should also work correctly.
Owner
|
Great catch, thanks! Would you mind fixing the relevant parts of |
Owner
|
Merging, I'll fix |
Contributor
Author
|
sorry, I got distracted by xmas prep :( thanks for the merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confusingly
sock.protois not analogous to the PROXY protocol's socketprotocol, rather the
sock.typeattribute is. In almost all casessock.protowill be zero as perhttps://docs.python.org/3/library/socket.html#socket.socket
This was resulting in the command
proxyprotocol-server --service localhost:8082 localhost:8080always injecting a PROXY protocol headerwith a protocol of int 0 to the downstream server. This PR fixes that,
it now correctly injects int 1 in the above scenario and the other
SocketKindlookups should also work correctly.