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

Check for CF-Connecting-IP and decreased timeout #544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 24, 2022

  1. Check for CF-Connecting-IP and decreased timeout

    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).
    skiby7 committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    0cd73f1 View commit details
    Browse the repository at this point in the history