nilsbe / python-proxy Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/python-proxy
Automatically exported from code.google.com/p/python-proxy
What steps will reproduce the problem?
1. Run the script from a python script
2.
3.
What is the expected output? What do you see instead?
You are in a infinite loop !
If for workaround, you try to launch it into a thread; it's not a good idea
because in pyhon you can't easily to force the stop it
In my script, I expecte:
- to launch the proxy and continue the script.
- to stop it
What version of the product are you using? On what operating system?
version: '0.1.0 Draft 1'
OS: Windows 7
Please provide any additional information below.
I propose you encapsulate the start/stop in a class:
See below (file in attachment), this example don't take into account the IPV6
and timeout
class ConnectionHandler(SocketServer.BaseRequestHandler):
#Instead of __init__
def handle(self):
self.client = self.request
....
class WebProxy:
def __init__(self):
self.server = None
def start(self, host='localhost', port=8080, IPv6=False, timeout=60,
handler=ConnectionHandler):
print "Start proxy server"
#For the moment only in IPV4
# if IPv6==True:
# For IPV6, override SocketServer.ThreadingTCPServer
# soc_type=socket.AF_INET6
# else:
# soc_type=socket.AF_INET
self.server = SocketServer.ThreadingTCPServer((host, port), handler)
# Start a thread with the server -- that thread will then start one
# more thread for each request
server_thread = threading.Thread(target=self.server.serve_forever)
# Exit the server thread when the main thread terminates
server_thread.daemon = True
server_thread.start()
def stop(self):
if self.server is not None:
print "Stop proxy server"
self.server.shutdown()
Original issue reported on code.google.com by [email protected]
on 28 Mar 2013 at 10:15
Attachments:
What steps will reproduce the problem?
1. Run python PythonProxy.py
2. Set system wide proxy server to localhost:8080
3. Load http://en.wikipedia.org/wiki/Affine_transformation
What is the expected output? What do you see instead?
I expect the page to be loaded completely with lots of inline equation images.
Many of the images fail to load.
What version of the product are you using? On what operating system?
PythonProxy v0.1.0, Ubuntu Linux 12.04.4, Chromium or Firefox browser
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Apr 2014 at 3:19
单独部署一个python程序太麻烦了,希望可以编译一个exe程序��
�就像goagent一样!@
Original issue reported on code.google.com by [email protected]
on 18 Feb 2012 at 3:34
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.