Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy support added to Client class. #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Proxy support added to Client class. #41

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented May 26, 2013

No description provided.

andreevskya and others added 3 commits May 26, 2013 13:27
Added proxy support to Client class.
Tabs and spaces were mixed. Fixed.
maxcutler added a commit that referenced this pull request Jun 29, 2014
Custom transports have the ability to modify the network behavior of the HTTP requests, to do things like proxying (see #41), timeouts (see #52), SSL certification validation (see #60), and more.
Fixes #61.
@maxcutler
Copy link
Owner

In version 2.3 I've exposed a transport parameter that you can pass with your custom transports. I'm not sure it makes sense to bundle particular transports in the library, but you should feel free to put it in a separate package and upload it to PyPI for easy sharing and consumption.

@Emad-AiDev
Copy link

Hello Max,

Have you had a time to fix the proxy issue ?
I need to use the code via proxy, could you help me please.
Thank you.

@maxcutler
Copy link
Owner

In my previous comment I said that I released version 2.3 with a new 'transport' parameter to the constructor that allows you to pass your own transports. You can even use the ProxiedTransport you had included in this pull request.

I haven't merged this PR because I'm not yet comfortable shipping transports as part of the core library itself. So instead I've made it simpler for users to supply their own.

@gagandeep
Copy link

I am getting following error when using ProxiedTransport on python 2.7.

Traceback (most recent call last):
  File "wp_post.py", line 33, in <module>
    wp = Client('http://www.example.com/xmlrpc.php', 'user', 'password', transport=p)
  File "/usr/local/lib/python2.7/dist-packages/wordpress_xmlrpc/base.py", line 24, in __init__
    self.supported_methods = self.server.mt.supportedMethods()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1294, in single_request
    response = h.getresponse(buffering=True)
AttributeError: HTTP instance has no attribute 'getresponse'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants