code added to establish proxy connection

in case direct connection is not possible