proxy support: update HTTP CONNECT to conform RFC2616

When connecting to the proxy we should include the Host-header into the
request. This is required by RFC2616 section 14.23 "A client MUST
include a Host header field in all HTTP/1.1 request messages".

While without this change some proxies reject connections, no such
problems appear with this patch applied.

Signed-off-by: Thomas Niederprüm <thomas.niederpruem@optimabit.com>
This commit is contained in:
dubit0 2017-05-10 09:15:24 +02:00 committed by GitHub
parent 2936a42bc7
commit c94f306030

View File

@ -6973,7 +6973,7 @@ fd_socket() {
pr_magenta "$PROG_NAME: unable to open a socket to proxy $PROXYIP:$PROXYPORT"
return 6
fi
echo "CONNECT $nodeip:$PORT" >&5
echo -en "CONNECT $NODE:$PORT HTTP/1.1\r\nHost: $NODE:$PORT\r\n\r\n" >&5
while true ; do
read proyxline <&5
if [[ "${proyxline%/*}" == "HTTP" ]]; then