├── README.md ├── install.sh └── poster.png /README.md: -------------------------------------------------------------------------------- 1 | # Install proxy server one line 2 | 3 | ![Test Image 1](https://raw.githubusercontent.com/zamanuhina/install-proxy-one-line/main/poster.png) 4 | 5 | # `bash <(wget git.io/JTUZP -qO-)` 6 | 7 | ```bash 8 | 9 | ... Please wait for a few seconds ... 10 | 11 | ---------------------------------------- 12 | YOUR PROXY - y0adXjeO:pAzAHCr4@54.82.74.24:55579 13 | ---------------------------------------- 14 | ``` 15 | 16 | **Username** - `y0adXjeO` 17 | **Password** - `pAzAHCr4` 18 | **IP** - `54.82.74.24` 19 | **Port** - `55579` 20 | 21 | ### Simple? - Yeah! 22 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | G='\033[0;32m' 4 | Y='\033[0;33m' 5 | NC='\033[0m' 6 | 7 | printf "\n" 8 | printf " ... Please wait for a few seconds ...\n" 9 | printf "\n" 10 | 11 | CHECK_OS="$(awk '/^ID=/' /etc/*os-release | awk -F'=' '{ print tolower($2) }')" 12 | 13 | if [ "${CHECK_OS}" = "debian" ] || [ "${CHECK_OS}" = "\"debian\"" ] || [ "${CHECK_OS}" = "ubuntu" ] || [ "${CHECK_OS}" = "\"ubuntu\"" ]; then 14 | DEBIAN_FRONTEND=noninteractive apt-get -y -qq update 15 | DEBIAN_FRONTEND=noninteractive apt-get -y -qq install apache2-utils squid3 wget 1>/dev/null 2>/dev/null 16 | elif [ "${CHECK_OS}" = "fedora" ] || [ "${CHECK_OS}" = "\"fedora\"" ]; then 17 | dnf -y install httpd-tools squid3 wget 1>/dev/null 2>/dev/null 18 | elif [ "${CHECK_OS}" = "centos" ] || [ "${CHECK_OS}" = "\"centos\"" ]; then 19 | yum install -y httpd-tools squid3 wget 1>/dev/null 2>/dev/null 20 | fi 21 | 22 | PROXY_USER="$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)" 23 | PROXY_PASS="$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)" 24 | PROXY_IP="$(wget http://ipecho.net/plain -O - -q)" 25 | PROXY_PORT="5$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)" 26 | 27 | SQUID_DIR="/etc/squid" 28 | SQUID_LIB="/usr/lib/squid" 29 | 30 | if [ ! -d "${SQUID_DIR}" ]; then 31 | SQUID_DIR="/etc/squid3" 32 | fi 33 | 34 | if [ ! -d "${SQUID_LIB}" ]; then 35 | SQUID_LIB="/usr/lib/squid3" 36 | fi 37 | 38 | if [ ! -f "${SQUID_DIR}/passwd" ]; then 39 | touch "${SQUID_DIR}/passwd" 40 | fi 41 | 42 | echo "${PROXY_PASS}" | htpasswd -i "${SQUID_DIR}/passwd" "${PROXY_USER}" 1>/dev/null 2>/dev/null 43 | 44 | touch "${SQUID_DIR}/squid.conf.new" 45 | 46 | cat <> "${SQUID_DIR}/squid.conf.new" 47 | http_port ${PROXY_PORT} 48 | auth_param basic program ${SQUID_LIB}/basic_ncsa_auth ${SQUID_DIR}/passwd 49 | auth_param basic children 5 50 | auth_param basic realm Squid Basic Authentication 51 | auth_param basic credentialsttl 2 hours 52 | acl auth_users proxy_auth REQUIRED 53 | request_header_access X-Forwarded-For deny all 54 | request_header_access Via deny all 55 | request_header_access Proxy deny all 56 | request_header_access Cache-Control deny all 57 | http_access allow auth_users 58 | EOT 59 | 60 | cat "${SQUID_DIR}/squid.conf" >> "${SQUID_DIR}/squid.conf.new" 61 | 62 | mv "${SQUID_DIR}/squid.conf.new" "${SQUID_DIR}/squid.conf" 63 | 64 | systemctl start squid3 1>/dev/null 2>/dev/null 65 | systemctl enable squid3 1>/dev/null 2>/dev/null 66 | systemctl restart squid3 1>/dev/null 2>/dev/null 67 | 68 | systemctl start squid 1>/dev/null 2>/dev/null 69 | systemctl enable squid 1>/dev/null 2>/dev/null 70 | systemctl restart squid 1>/dev/null 2>/dev/null 71 | 72 | printf "${Y}----------------------------------------${NC}\n" 73 | printf "${G}YOUR PROXY - ${PROXY_USER}:${PROXY_PASS}@${PROXY_IP}:${PROXY_PORT}\n" 74 | printf "${Y}----------------------------------------${NC}\n" 75 | printf "\n" 76 | -------------------------------------------------------------------------------- /poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zamanuhina/install-proxy-one-line/10a92fc1ac848b64d8892bd57fd8c0b603460058/poster.png --------------------------------------------------------------------------------