Python HTTP server that supports chunked encoding?

后端 未结 4 838
醉话见心
醉话见心 2021-01-12 08:32

I\'m looking for a well-supported multithreaded Python HTTP server that supports chunked encoding replies. (I.e. \"Transfer-Encoding: chunked\" on responses). What\'s the

4条回答
  •  春和景丽
    2021-01-12 09:32

    I am pretty sure that WSGI compliant servers should support that. Essentially, WSGI applications return iterable chunks, which the webserver returns. I don't have first hand experience with this, but here is a list of compliant servers.

    I should think that it would be fairly easy to roll your own though, if WSGI servers dont meet what you are looking for, using the Python's builtin CGIHTTPServer. It is already multithreaded, so it would just be up to you to chunk the responses.

提交回复
热议问题