Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:31:10+00:00 2026-06-11T14:31:10+00:00

I am trying to maintain a pool of connections to a proxy. My code

  • 0

I am trying to maintain a pool of connections to a proxy. My code looks like this:

>>> from urllib3 import PoolManager
>>> pool = PoolManager(10)
>>> pool.urlopen('GET', 'http://http-server/index.html',fields=None,headers=None,encode_multipart=False,multipart_boundary=None,proxies={'http': 'http://proxy'})

When I run this, it is failing:

> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in   <module>
>   File "urllib3/poolmanager.py", line 117, in urlopen
>     response = conn.urlopen(method, u.request_uri, **kw)
> File "urllib3/connectionpool.py", line 427, in urlopen
>     **response_kw)   
> File "urllib3/response.py", line 195, in from_httplib
>     **response_kw) 
> TypeError: __init__() got an unexpected keyword argument 'proxies'

Any idea what I am doing wrong? According to urllib3 docs, keyword args are sent to urlopen, but looks like it is not happening in this case.

Here is the link to urllib describing the usage of proxy keyword arg.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:31:11+00:00Added an answer on June 11, 2026 at 2:31 pm

    The docs you linked to are to Python’s urllib, which is a different library than urllib3. When you call urllib3’s urlopen, that’s not the same urlopen as urllib’s. Sorry for the confusion. 🙂

    At the moment, using a proxy with urllib3 is not well-documented. If you want to explore the urllib3 code, take a look at urllib3.poolmanager.ProxyManager.

    Otherwise, I suggest trying Requests which streamlines the proxies feature on top of urllib3. See: http://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies

    Your code would look something like this.

    >>> import requests
    >>> requests.get('http://http-server/index.html', proxies={'http': 'http://proxy'})
    

    If you’d still prefer to use urllib3, then using the ProxyManager would look something like this:

    >>> import urllib3
    >>> http = urllib3.proxy_from_url('http://myproxy.com/')  # This returns a ProxyManager object which has the same API as other ConnectionPool objects.
    >>> r = http.request('GET', 'http://http-server/index.html')
    

    You could also create your own ProxyManager object directly, but I prefer to use the proxy_from_url shortcut.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to maintain/update/rewrite/fix a bit of Python that looks a bit like this:
Trying to figure out how I can do this properly. The print_r looks like
I'm trying to maintain state on an object by doing something like this: obj
I am trying to maintain my session variables that I get back in a
I'm trying to maintain databases synchronized between a Webservice and Android app. The code
I am trying to floss daily, get my exercise, and make sure I maintain
I am trying to maintain code that compiles on lots of different systems. I've
I'm currently trying write code that will maintain the sorting preference while changing page
I'm trying to maintain one repository, most everything in my code base is source,
I'm brand new to log4net, and I'm trying to maintain some legacy code that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.