Update connection.c

it's better to check and resolve the connection use the FQDN first instead of ip address, due to the issue of getting internal ip address that's getting "Resource Access Denied" response.
Update redirection.c

this is related to the changes in connection.c that we should resolve using the FQDN first, where trying an internal get us into RAP Access denied issue.
Merge pull request #1730 from divineforge/master

Fixing the E_PROXY_RAP_ACCESSDENIED error