Я не очень хорошо знаю платформу Linux, но вы можете позволить программе делать исходящие запросы из командной строки, например, из python:
import sys
import os
def allow_outbound_connections(program_path):
"""
Allow program outbound connections.
"""
if "win" in sys.platform:
command = f'netsh advfirewall firewall add rule name="{program_path}" '\
'dir=out action=block program= "{os.path.basename(program_path}"'\
' enable=yes profile=any'
if "linux" in sys.platform:
# *Add a similar command in Linux*
with os.popen(command) as stream:
return stream.read()
def main():
# First allow this program to make outbound connections.
output = allow_outbound_connections(__file__)
# (Eventually you could handle the output)
# Now make request to an outside network url.