title: How can I set a single proxy for a requests session object?
body: <p>I'm using the Python requests package to send http requests. I want to add a single proxy to the requests session object. eg.</p>
  
  <pre><code>session = requests.Session()
  session.proxies = {...} # Here I want to add a single proxy
  </code></pre>
  
  <p>Currently I am looping through a bunch of proxies, and at each iteration a new session is made. I only want to set a single proxy for each iteration.</p>
  
  <p>The only example I see in the documentation is:</p>
  
  <pre><code>proxies = {
      "http": "http://10.10.1.10:3128",
      "https": "http://10.10.1.10:1080",
  }
  
  requests.get("http://example.org", proxies=proxies)
  </code></pre>
  
  <p>I've tried to follow this, but to no avail. Here is my code from the script:</p>
  
  <pre><code># eg. line = 59.43.102.33:80
  r = s.get('http://icanhazip.com', proxies={'http': 'http://' + line})
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>requests.packages.urllib3.exceptions.LocationParseError: Failed to parse 59.43.102.33:80
  </code></pre>
  
  <p>How is it possible to set a single proxy on a session object?</p>