text
stringlengths
1
93.6k
if SETTINGS["HTTP_Port"] == 80:
menu += "\n" + center_menu_item(f"Your HTTP IP is {SETTINGS['HTTP_Interface_IP']}")
else:
menu += "\n" + center_menu_item(f"Your HTTP IP is {SETTINGS['HTTP_Interface_IP']} on port {SETTINGS['HTTP_Port']}")
if SETTINGS["HTTPS"]:
if SETTINGS["HTTPS_Port"] == 443:
menu += "\n" + center_menu_item(f"Your HTTPS IP is {SETTINGS['HTTPS_Interface_IP']}")
else:
menu += "\n" + center_menu_item(f"Your HTTPS IP is {SETTINGS['HTTPS_Interface_IP']} on port {SETTINGS['HTTPS_Port']}")
if SETTINGS["DNS"]:
if SETTINGS["DNS_Port"] == 53:
menu += "\n" + center_menu_item(f"Your DNS IP is {SETTINGS['DNS_Interface_IP']}")
else:
menu += "\n" + center_menu_item(f"Your DNS IP is {SETTINGS['DNS_Interface_IP']} on port {SETTINGS['DNS_Port']}")
print_line()
print(menu)
print_line()
def getch():
"""MIT Licensed: https://github.com/joeyespo/py-getch"""
import termios
import tty
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
try:
tty.setraw(fd)
return sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)
def closer(message):
print(message)
if message != "\r>> Exiting... ":
print("Press any key to exit...", end="")
sys.stdout.flush()
if os.name == "nt":
from msvcrt import getch as w_getch
w_getch()
else:
getch()
print()
sys.exit()
def default_settings():
global SETTINGS
SETTINGS = {
"Debug": False,
"Root_Check": True,
"Public": False,
"DNS": True,
"HTTP": True,
"HTTPS": True,
"DNS_Interface_IP": "",
"DNS_Port": 53,
"HTTP_Interface_IP": "",
"HTTP_Port": 80,
"HTTPS_Interface_IP": "",
"HTTPS_Port": 443,
"Compression_Level": 0,
"UA_Check": False,
"Theme": "Default",
"Auto_Payload": "",
"Payload_Timeout": 60,
"DNS_Rules": {
"Redirect_IP": "",
"Redirect": [],
"Block": [],
"Pass_Through_IP": []
},
"Valid_UA": [],
"Update": {
"PS4_No_Update": 1.76,
"PS5_No_Update": 4.51,
"Vita_No_Update": 3.65
},
"Languages": {
"English": "en"
}
}
def import_settings(settings_file):
global SETTINGS # pylint: disable=global-variable-not-assigned
try:
with open(settings_file, "rb") as buf:
imported = json.loads(buf.read())
except (IOError, PermissionError):
print("ERROR: Unable to read settings.json, using defaults")
return
except json.decoder.JSONDecodeError: