From 614449c6ad177375d05305774343da8e1a013128 Mon Sep 17 00:00:00 2001 From: forkbomber Date: Sat, 31 Oct 2015 19:49:18 -0400 Subject: [PATCH] core.c: add HOST header to each CONNECT request fixes #92 --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index ea6417f..0f54c52 100644 --- a/src/core.c +++ b/src/core.c @@ -237,7 +237,7 @@ static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt, c } else dst[0] = 0; len = snprintf((char *) buff, sizeof(buff), - "CONNECT %s:%d HTTP/1.0\r\n%s%s%s\r\n", + "CONNECT %1$s:%2$d HTTP/1.0\r\nHost: %1$s:%2$d\r\n%3$s%4$s%5$s\r\n", dns_name, ntohs(port), ulen ? "Proxy-Authorization: Basic " : dst, dst, ulen ? "\r\n" : dst);