I am trying to make request through a SOCKS5 proxy server over HTTPS but it fails or returns the empty string. I am using PySocks
library.
Here is my example
WEB_SITE_PROXY_CHECK_URL = "whatismyipaddress.com/"
REQUEST_SCHEMA = "https://"
host_url = REQUEST_SCHEMA + WEB_SITE_PROXY_CHECK_URL
socket.connect((host_url, 443))
request = "GET / HTTP/1.1\nHost: " + host_url + "\nUser-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11\n\n"
socket.send(request)
response = socket.recv(4096)
print response
But it doesn't work, it prints an empty string response.
Is there any way to make HTTPS request through the socks5 proxy in Python ?
Thanks