Fixed a bug for proxy-enabled connections

Fixed a bug for proxy-enabled connections.