Giter Club home page Giter Club logo

Comments (4)

mahmoud avatar mahmoud commented on May 18, 2024

Even though urllib3 doesn't use httplib too much, a full rewrite of something this fundamental can be involved. I would highly recommend these links for the lazy:

As for the design thus far, the enhancements are tentatively broken into creating specialized Managers (aka Pool Managers) that implement specialized behavior (e.g., proxying, caching, etc.) and lower-level httplib-replacement classes like Connection, Request (HTTPRequest), and Response (HTTPResponse). Connection manages basic socket behaviors and more advanced transport behaviors like handshaking. Request/Response mostly handle parsing/serialization stuff.

General patterns for customization are inheritance (i.e., HTTPSRequest could be a child of HTTPRequest. Other requests like FTPRequest should be possible), and type passing (i.e., telling Manager type Foo to use Connection type Bar).

As for enhancement-specific links, I recommend:

  • benoitc's http-parser - Modern and much improved handling of the response parsing side. Ported from mongrel/node.js for use in gunicorn, it has pure Python and Cython versions available in the linked repo.
  • py-nonblocking-http - A Google project from 2010 that provides a non-blocking-socket-compatible replacement for httplib's Connection class. While not directly applicable on the whole, it does demonstrate:
    • How to replace 90% of httplib
    • How to unify HTTP and HTTPS Connections, if that is desirable
    • Some of the complexities of handshaking and redirects in a non-httplib context

You'll note that it is still quite opaque and monolithic, so, again, just for reference.

from urllib3.

shazow avatar shazow commented on May 18, 2024

@makuro Thanks for organizing this and writing it up. :)

from urllib3.

kennethreitz avatar kennethreitz commented on May 18, 2024

This is so exciting.

from urllib3.

shazow avatar shazow commented on May 18, 2024

Still hopeful for this someday but it'd be a huge project. Maybe with a sponsor or something.

from urllib3.

Related Issues (20)

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.