added headers option
improved default_port detection
fixed bug with proxies + redirects