Added handling of proxy IP and ports for connection