Check for CF-Connecting-IP and decreased timeout#544
Open
skipperoo wants to merge 1 commit intoSnapDrop:masterfrom
Open
Check for CF-Connecting-IP and decreased timeout#544skipperoo wants to merge 1 commit intoSnapDrop:masterfrom
skipperoo wants to merge 1 commit intoSnapDrop:masterfrom
Conversation
When hosting Snapdrop behind Cloudflare, X-Forwarded-For is useless. Furthermore, I'm hosting my installation behind another internal proxy, so, in the end, X-Forwarder-For is set to the internal proxy's IP for all the peer, which can see each other regardless being on different networks. To fix this I made _setIP check if the header "cf-connecting-ip" exists, then sets the IP accordingly. Lastly, when a peer changes network (e.g. a phone switches from wifi to mobile data), the function _leaveRoom is not called and the peer stays visible to others connected to the same room for a whole minute: I adjusted the timeout to what I think is a more reasonable value (500ms, so _leaveRoom is called after 1s).
dxlliv
added a commit
to dxlliv/snapshare
that referenced
this pull request
May 28, 2023
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.
When hosting Snapdrop behind Cloudflare,
X-Forwarded-Foris useless. Furthermore, I'm hosting my installation behind another internal proxy, so, in the end,X-Forwarder-Foris set to the internal proxy's IP for all the peer, which can see each other regardless being on different networks. To fix this I made_setIPcheck if the header "cf-connecting-ip" exists, then sets the IP accordingly.Lastly, when a peer changes network (e.g. a phone switches from wifi to mobile data), the function
_leaveRoomis not called and the peer stays visible to others connected to the same room for a whole minute: I adjusted the timeout to what I think is a more reasonable value (500ms, so_leaveRoomis called after 1s).