f-list / fserv

Repository for the F-Chat server implementation.
BSD 2-Clause "Simplified" License
10 stars 5 forks source link

Only try to apply proxy url if there's an x-forwarded-for header #57

Closed boopcat closed 8 years ago

boopcat commented 8 years ago

ip will still be "" if no forwarded header this allows non-proxy clients to connect from localhost!

kiranoot commented 8 years ago

Unfortunately this breaks the sanity check and warning for the proxy ip forwarding. Because ip concurrency is determined and based around the ip reporting, it is vital that the server get a x-forwarded-for address from the proxy, or fail if it doesn't. For development purposes I would suggest that you connect to the LAN address of the machine instead of to the loopback address, as this bypasses the check and preserves the ip accounting code. Alternatively, adding an additional ip to the loopback interface will also work, as the only valid address for the proxy is 127.0.0.1