Fix for multiple chained hosts in HTTP_X_FORWARDED_HOST, cURL proxy supoort

This pull request contains:

 - a small fix for the cases when there is more than one proxy, and HTTP_X_FORWARDED_HOST contains a comma separated list of all the proxy hosts the request was passed through; example: when the application is behind domainA.com and domainB.com,  HTTP_X_FORWARDED_HOST contains 'domainB.com, domainA.com'.

 - added proxy support for accessing the remote Facebook API; some corporate servers are not directly exposed to the wild, but instead they must use internal proxies to access the web.