Added local ip address fallback if external fails

-fixed it so that it checks to see if it can connect to server using
external ip address, if it fails it falls back to trying local ip (this
lets me test behind my firewall without having to keep changing the
code)