Skip to content

Instantly share code, notes, and snippets.

@GINK03
Created January 4, 2020 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GINK03/6528e527419bfde7913265bf8adb5931 to your computer and use it in GitHub Desktop.
Save GINK03/6528e527419bfde7913265bf8adb5931 to your computer and use it in GitHub Desktop.
medium_softether_vpn.py
USERNAME = input('USERNAMEを指定してください:')
PASSWORD = input('PASSWORDを指定してください:')
PSK = input('PSKのパスワードを指定してください:')
query = \
['docker',
'run',
'-d',
'--cap-add',
'NET_ADMIN',
'-p',
'500:500/udp',
'-p',
'4500:4500/udp',
'-p',
'1701:1701/tcp',
'-p',
'1194:1194/udp',
'-p',
'5555:5555/tcp',
'-e',
f'USERNAME={USERNAME}',
'-e',
f'PASSWORD={PASSWORD}',
'-e',
f'PSK={PSK}',
'siomiz/softethervpn']
with Popen(query, stdout=PIPE, stdin=PIPE) as proc:
proc.wait(timeout=60)
reader = io.TextIOWrapper(proc.stdout)
while True:
r = reader.read(1)
if not r:
break
print(r, end='', flush=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment