* proxying now uses curl instead of ncat

merge-requests/2/head
Dominika Liberda 2021-06-01 22:06:25 +02:00
parent 46e77541cf
commit 4ce0667870
1 changed files with 11 additions and 15 deletions

View File

@ -9,20 +9,16 @@ host="$(sed -E 's@http(s|)://@@;s@/.*@@' <<< "$url")"
headers="$(tr '\r' '\n' <<< "${r[req_headers]}")"
headers+=$'\n'
while read line; do
if [[ "$line" == "GET"* ]]; then
if [[ "$url" == *"$host" ]]; then
echo "GET / HTTP/1.1"
else
echo "GET /$(sed -E 's@http(s|)://@@;s@/@<40><>Lun4_iS_CuTe<54>@;s@.*<2A><>Lun4_iS_CuTe<54>@@' <<< "$url") HTTP/1.1"
fi
elif [[ "$line" == *"Host"* ]]; then
echo "Host: $url" | sed -E 's@http(s|)://@@;s@/.*@@'
else
echo "$line"
if [[ "$line" != "GET"* && "$line" != "Host:"* && "$line" != '' ]]; then
params+="-H '$line' "
fi
done <<< "$headers" | if [[ "$url" == "https"* ]]; then
nc $host 443 --ssl -C -i 0.1 --no-shutdown
else
nc $host 80 -C -i 0.1 --no-shutdown
fi
done <<< "$headers"
curl -v --http1.1 "$url" "$params" -D /dev/stdout | grep -aiv "Transfer-Encoding: chunked"
#if [[ "$url" == "https"* ]]; then
#nc $host 443 --ssl -C -i 0.1 --no-shutdown
#else
#nc $host 80 -C -i 0.1 --no-shutdown
#fi