Comments (3)
this looks like a reasonable request.
Please can you fork my repo and submit a PR. Also can you make sure that
little things like spaces after ,
are added to make the code conform
stylewise.
David
David Burns
Email: [email protected]
URL: http://www.theautomatedtester.co.uk/
On Mon, Sep 22, 2014 at 11:28 PM, i5513 [email protected] wrote:
Hello,
I would like to propose to support starting a new proxy configured to use
a http proxy. At https://github.com/lightbody/browsermob-proxy we can see
, that we can :
[~]$ curl -X POST
http://localhost:9090/proxy?httpProxy=yourproxyserver.com:8080
{"port":9091}I propose the next simple patch:
diff --git a/browsermobproxy/client.py b/browsermobproxy/client.py
index 20827f3..f9302e4 100644
--- a/browsermobproxy/client.py
+++ b/browsermobproxy/client.py
@@ -4,15 +4,17 @@ import jsonclass Client(object):
- def init(self, url):
- def init(self, url,params={}):
"""
Initialises a new Client object:param url: This is where the BrowserMob Proxy lives
:param params: URL query (for example httpProxy and httpsProxy vars) """ self.host = "http://" + url
resp = requests.post('%s/proxy' % self.host, urlencode(''))
urlparams="?"+urlencode(params) if params else ""
resp = requests.post('%s/proxy' % self.host + urlparams) jcontent = json.loads(resp.content) self.port = jcontent['port'] url_parts = self.host.split(":")
diff --git a/browsermobproxy/server.py b/browsermobproxy/server.py
index 7857a06..e8e8e37 100644
--- a/browsermobproxy/server.py
+++ b/browsermobproxy/server.py
@@ -85,12 +85,14 @@ class Server(object):
"""
return "http://localhost:%d" % self.portdef create_proxy(self):
def create_proxy(self,params={}):
"""
Gets a client class that allow to set all the proxy details that you
may need to.:param params: Dictionary where you can specify params \
like httpProxy and httpsProxy """
client = Client(self.url[7:])
client = Client(self.url[7:],params) return client
def _is_listening(self):
If you prefer I fork and make a pull request, please tell me ( I think it
is better that smaller changes like this is ok with a patch inline a
comment)Do you think it is appropiate to include in your next release?
Thanks
—
Reply to this email directly or view it on GitHub
#27.
from browsermob-proxy-py.
If I understand correctly, with this change I can add a proxy connection to BMP, like this:
PythonCode + Selenium --> BMP --> External Proxy --> The Internet
I tried using the Server.create_proxy({'httpProxy' : ":", 'httpsProxy' : ":"}), then I tried loading a WhereIsMyIpService (http://www.whereisip.net), and still stay in my country :(
Is my problem or BMP isn't connecting to the proxy ?
PD. Also is a private proxy and I pass the header that I need: proxy.headers({'Proxy-Authorization':'blahblahblah'}).
from browsermob-proxy-py.
Hello, Joseph, since I made the push request I did not test / use browsermob proxy. My proxy was working, but it did not need any authorization nor autenticación. So I dont know if it is supported
Regards
from browsermob-proxy-py.
Related Issues (20)
- how to clear old page's network
- How to use with selenium-webdriver for IE?
- Getting error 'The Browsermob-Proxy server process failed to start' HOT 2
- Add ssl cert (#59) HOT 1
- Unable to clear blacklist
- Please push latest updates to PyPi HOT 6
- "No JSON object could be decoded" HOT 3
- using pip to install browsermob-proxy encounter exceptions
- Trusting all Servers and bypassing Basic Authentication HOT 2
- Modifying Connection header HOT 1
- profile.set_proxy(proxy.selenium_proxy()) HOT 5
- "pip install" installs browsermob-proxy 0.8.0, not 2.0 or 2.1.5 HOT 4
- Getting the error "browsermobproxy.exceptions.ProxyServerError" HOT 3
- cannot configure options for start server
- Another server running on this port or An existing connection was forcibly closed by the remote host
- This method has been deprecated. Please pass in the proxy object to the Driver Object HOT 2
- How to use browsermob with python-selenium behind a corporate proxy? HOT 2
- Cannot install browsermobproxy with pip nor python -m pip HOT 1
- Unable to locate dependent libraries when absolute path is not given to the Server() instance HOT 2
- 404 returned when call basic_authentication method. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browsermob-proxy-py.