Add support for getting the real client IP behind proxies

Fixes https://github.com/owncloud/core/issues/10624