def proxy_connect(args):
 if args.proxy_host:
  if ((args.proxy_type.lower() == 'socks5') or (not args.proxy_type)):
   socks.set_default_proxy(socks.SOCKS5, args.proxy_host, int(args.proxy_port))
  elif (args.proxy_type.lower() == 'http'):
   socks.set_default_proxy(socks.HTTP, args.proxy_host, int(args.proxy_port))
  elif (args.proxy_type.lower() == 'socks4'):
   socks.set_default_proxy(socks.SOCKS4, args.proxy_host, int(args.proxy_port))
  else:
   printNicely(magenta('Sorry, wrong proxy type specified! Aborting...'))
   sys.exit()
  socket.socket = socks.socksocket

def proxy_connect ( args ) : if args . proxy_host : if ( ( args . proxy_type . lower ( ) == 'socks5' ) or ( not args . proxy_type ) ) : socks . set_default_proxy ( socks . SOCKS5 , args . proxy_host , int ( args . proxy_port ) ) elif ( args . proxy_type . lower ( ) == 'http' ) : socks . set_default_proxy ( socks . HTTP , args . proxy_host , int ( args . proxy_port ) ) elif ( args . proxy_type . lower ( ) == 'socks4' ) : socks . set_default_proxy ( socks . SOCKS4 , args . proxy_host , int ( args . proxy_port ) ) else : printNicely ( magenta ( 'Sorry, wrong proxy type specified! Aborting...' ) ) sys . exit ( ) socket . socket = socks . socksocket
connect to specified proxy .