From 4015b9b891b110502c198006daf15a6c52c990f8 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Tue, 24 Mar 2020 21:15:46 +0100 Subject: [PATCH] supply proxy ip from cli --- panxy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panxy.py b/panxy.py index 1999d3e..f5aedaf 100644 --- a/panxy.py +++ b/panxy.py @@ -5,9 +5,12 @@ from urllib import request import sys target = "http://theresno.cloud/ip" -proxy_handler = request.ProxyHandler({'https': 'http://felixpankratz.de:80/', 'http': 'http://felixpankratz.de:80/' }) +prx = sys.argv[1] +print("Using proxy " + prx + " ...") +proxy_handler = request.ProxyHandler({'https': 'http://' + prx + '/', 'http': 'http://' + prx + '/' }) opener = request.build_opener(proxy_handler) +result = opener.open(target) content = result.read().decode() print(content)