Giter Site home page Giter Site logo

python-proxy's People

Watchers

 avatar

python-proxy's Issues

Fails to load images on a Wikipedia page

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-proxy can not be stopped automatically

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:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.