-
Notifications
You must be signed in to change notification settings - Fork 0
/
localhost.sh
32 lines (30 loc) · 1.16 KB
/
localhost.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
#Coded By Joy Ghosh
clear
white='\e[1;37m'
red='\e[1;31m'
yellow='\e[1;33m'
green='\e[0;32m'
echo -e """ $yellow
█░░ █▀█ █▀▀ ▄▀█ █░░ █░█ █▀█ █▀ ▀█▀ ░ █▀█ █░█ █▄░█
$red█▄▄ █▄█ █▄▄ █▀█ █▄▄ █▀█ █▄█ ▄█ ░█░ ▄ █▀▄ █▄█ █░▀█ [JoyGhosh]
$white---------------------------------------------------------
| From http://localhost.run |
---------- Expose Localhost over Internet ---------------$red
"""
read -p "Enter Port Of Your Localhost--> " po
read -p "Enter an random-string for Generating Subdomains --> " sub
ok=200
resp=$(curl -s -o /dev/null -I -w "%{http_code}" localhost:$po)
echo -e "$yellow<-------------------------------------------------------------------->$white"
echo "Cheaking If LocalHost Is Running Or Not/"
echo "----------------------------------------"
if [ $ok == $resp ]
then
echo -e "Localhost $green Running $white"
ssh -R 80:localhost:$po $sub@ssh.localhost.run
else
echo -e "Localhost $red Not Running $white"
echo "exiting"
exit
fi