Sha Hua | 27 Jan 18:58 2014

How to write an HTTP1.1 Proxy using Twisted?

Hi all,

I have recently started to learn and use Twisted. The first task is to write an HTTP proxy.
I found Twisted provides a built-in proxy module described here:

It says the server part inherits http.HTTPChannel, while the client part inherits http.HTTPClient.

However, as I later find out, http.HTTPClient is only a HTTP 1.0 client, which is not enough for my task. I also found there is another class called twisted.web.client.Agent which seems to be more advanced than http.HTTPClient and supports HTTP 1.1.

1. Can twisted.web.client.Agent be used in a Proxy implementation with http.HTTPChannel? Is there any examples?
2. Does http.HTTPChannel support HTTP 1.1?


Twisted-web mailing list
Twisted-web <at>
yoni s | 8 Dec 22:21 2013

Streaming MP3 using twisted matrix

Hi All,

I'm looking for a simple example that streams MP3 over http. 

I know how to Google, and even to use GitHub search but while I found several examples for using python I didn't find anything using twisted.

Any help would be appreciated 

Twisted-web mailing list
Twisted-web <at>
HawkOwl | 8 Nov 19:49 2013

Twisted 13.2.0 Release Announcement

On behalf of Twisted Matrix Laboratories, I am honoured to announce
the release of Twisted 13.2!

The highlights of this release are:

 * Twisted now includes a HostnameEndpoint implementation which uses
IPv4 and IPv6 in parallel, speeding up the connection by using
whichever connects first (the 'Happy Eyeballs'/RFC 6555 algorithm).

 * Improved support for Cancellable Deferreds by kaizhang, our GSoC
student. (#4320, #6532, #6572, #6639)

 * Improved Twisted.Mail documentation by shira, our Outreach Program
for Women intern. (#6649, #6652)

 * twistd now waits for the application to start successfully before
exiting after daemonization. (#823)

 * SSL server endpoint string descriptions now support the
specification of chain certificates. (#6499)

 * Over 70 closed tickets since 13.1.0.

For more information, check the NEWS file (link provided below).

You can find the downloads at <>
(or alternatively <>) .
The NEWS file is also available at

Many thanks to everyone who had a part in this release - the
supporters of the Twisted Software Foundation, the developers who
contributed code as well as documentation, and all the people building
great things with Twisted!

Twisted Regards,
Axel Rau | 5 Nov 13:19 2013

deployment with twistd of simple web application


just doing my 1st dynamic web application with twisted.

I have some working python modules, where the entry point is:
resource = RootWeatherPage()
meteoFactory = Site(resource)
reactor.listenTCP(80, factory, interface='some IP4')
reactor.listenTCP(80, factory, interface='some IP6')

Now I want to use twistd web.
How do I do that?

Thanks Axel
PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing  <at>  chaos claudius

Twisted-web mailing list
Twisted-web <at>
Phil Mayers | 16 Sep 18:58 2013

Double tracebacks for t.web & klein

I'm playing with klein for a simple rest API (because I like the 
routing, mainly).

When a method raises an exception, a traceback gets logged twice - once 
by the t.web Request.processingFailed, called from here:

...and once by the deferred garbage collection, as 
Request.processingFailed doesn't eat the deferred:

Obviously this double-traceback thing is hugely irritating. Who is at 
fault here? Is t.web doing the right thing by returning the failure from 
processingFailed, or is klein doing the wrong thing, either by using the 
(undocumented) processingFailed or omitting an errback further down the 

Obviously there's no way for *me* to add an errback - klein generates 
the deferred for me.
D Brian Kimmel | 29 Jul 20:01 2013

Need Help


I have a large home automation project that uses twisted.
I am adding a web interface and need athena for COMET activity.

I have been having a very hard time finding any current documentation to help 
me get the athena part working.
I am looking for brains to pick on getting this portion working bi-

I am also looking for others who may be interested in working on this type of 

github -> DBrianKimmel/PyHouse

Pranav Bhardwaj | 17 Jul 02:58 2013

twisted.web : limiting file size during upload (using python)


I have a script to be able to upload logs to a twisted web server.

I have the following requirements:

1) to be able to limit the size of the upload to 10MB.
2)  to NOT store file in memory during the request.

Does twisted.web provide these functionality?

Any inputs on these would be welcome!

Here is the server part os the script:

            oStream = open(filename, 'wb')

            # handle exception

a test client script:

<!DOCTYPE html>


<form action="https://serverUrl"



<div class="row">

<label for="fileUploadToServer">Select file</label><br />

fname : <input type="file" name="fname" />

<input type="submit" value="submit">




Twisted-web mailing list
Twisted-web <at>
Alexei Colin | 13 Jul 21:15 2013

Add response logging to example


The example processes the request, but not the
response. Yes, one can learn how to do that from the docs and from
stackoverflow, but that is an avoidable time burden. Sometimes this
example is all one needs, if only it were complete with both directions.

Could the example be revised or new one added with something like the
attached? Thank you for the consideration.

Attachment ( text/x-python, 2377 bytes
Twisted-web mailing list
Twisted-web <at>
Christopher Lozinski | 8 Jul 00:06 2013

Re: Nginx vs Twisted Web

 Thank so much to all of you for the excellent discussion on this topic.

I particularly liked Jean Paul from Twisted matrix's careful response.

And Burak Arslan's comment about Nginx supporting SendFile was hugely interesting.

So which one of those two did I choose?  At first I was going to go to Nginx, but then a developer I am cooperating with, who is also doing a Zope 3 server
went with Cherokee, and I followed in his lead.  Why???  Well Cherokee has a web GUI, that hugely simplifies my life, and the guy I am
cooperating with and I can support each other.  Really ease of use trumps all other issues for me.  I just have way way too much complexity that I am managing in life.

You can read more about my decision here.

If people want to continue this discussion, I would love to see a comparison of Twisted Web and Cherokee.  Best to start a new thread for that.

And if there were a web gui for Twisted Web, I would certainly have gone with that, even if it were an early release.  I can imagine one could create resources TTW Through The Web,
and store them in the ZODB.   Eventually I would like to see a tighter integration between Twisted Web and Zope 3.  I am starting with the release of Zope 3.  But all things take time. 

Christopher Lozinski

Twisted-web mailing list
Twisted-web <at>
Tristan Seligmann | 2 Jul 16:25 2013

Re: Nginx vs Twisted Web

On Tue, Jul 2, 2013 at 3:25 PM, Richard Wall <m-lists <at>> wrote:

Another problem is that Twisted doesn't yet support SSL on adopted sockets.

Is there a bug report for this? I would have expected it to Just Work (using twisted.protocols.tls, that is).
mithrandi, i Ainil en-Balandor, a faer Ambar
Twisted-web mailing list
Twisted-web <at>
Christopher Lozinski | 2 Jul 00:45 2013

Re: Twisted-web Digest, Vol 110, Issue 1

On 7/1/13 1:00 PM,Phil Mayers <p.mayers <at>> wrote:
> >
> > I'm a newbie to Python, but not programming.  However, my problem is
> > replacing an antiquated web-based classroom-attendance oriented
> > software app.
If you are looking at python, you have a lot of choices.

The first choice is which database to use, object-oriented, or relational.

If you choose relational, then django is the mainstream choice.

If you choose object oriented, then you can consider ZODB.  It stores a
persistent network of objects.  Which leads to either the Zope 3 / web framework, or else
pyramid.  Pyramid is good for simpler applications, as they get more
complicated, I would recommend  and

Better yet, just get a complete school application at

built on top of zope 3, very easy to make any customizations you want,
that is the greatest strength of Zope 3.