handle proxied request and different hostnames, ports and protocols