Fix crashbug when connecting to an IP address through the proxy

fixes #1