N
N
numitus22015-03-25 22:41:48
Python
numitus2, 2015-03-25 22:41:48

How to make https request in python 3.4 through proxy?

I need to make an https request (GET and POST) to the server through a proxy (HTTP, SOCKS5) or without them. urllib does not support SOCKS5 requests. Httplib2 doesn't want to work through a proxy at all. What other options will there be?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
chemiron, 2015-03-26
@chemiron

If you don't mind third party libraries, try requests.

import requests
proxies = {
  "http": "http://10.10.1.10:3128",
  "https": "http://10.10.1.10:1080",
}
requests.get("https://example.org", proxies=proxies)

A
Anatoly Scherbakov, 2015-03-26
@Altaisoft

There is a fork of a relatively old version of requests that can work with SOCKS proxies - requesocks .
In the future, this functionality should migrate to requests.

L
lPolar, 2015-03-27
@lPolar

Try grab, there are both normal and SOCKS proxies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question