powervm / pypowervm

Python library for interacting with the PowerVM API
Apache License 2.0
26 stars 14 forks source link

Provide possibility of configuring an HTTP proxy for the Adapter/Session objects #19

Open arthurzenika opened 1 year ago

arthurzenika commented 1 year ago

When using pypowervm on an API that is behind a http proxy, it would be nice to be able to configure a proxy when creating an Session or Adapter object.

This could be set as an argument when creating Session object https://github.com/powervm/pypowervm/blob/master/pypowervm/adapter.py#L64-L68

arthurzenika commented 1 year ago

As a bad workaround for the moment I am using socket and sock configuration :

import socket
import socks
# example for a socks5 proxy on localhost and port 8123
socks.set_default_proxy(socks.SOCKS5, "localhost", 8123)
socket.socket = socks.socksocket