Sha Hua | 27 Jan 18:58 2014
Picon

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.

Questions:
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?

Thanks!

Sha
_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
yoni s | 8 Dec 22:21 2013
Picon

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 

Thanks,
Yoni
_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
HawkOwl | 8 Nov 19:49 2013
Picon

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).
(#4859)

 * 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 <https://pypi.python.org/pypi/Twisted>
(or alternatively <http://twistedmatrix.com/trac/wiki/Downloads>) .
The NEWS file is also available at
<http://twistedmatrix.com/Releases/Twisted/13.2/NEWS.txt>.

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,
HawkOwl
Axel Rau | 5 Nov 13:19 2013
Picon

deployment with twistd of simple web application

Hi,

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')
reactor.run()
---

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> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Phil Mayers | 16 Sep 18:58 2013
Picon

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:

https://github.com/twisted/klein/blob/master/klein/resource.py#L125

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

http://twistedmatrix.com/trac/browser/tags/releases/twisted-13.1.0/twisted/web/server.py#L314

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 
chain?

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

Howdy,

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-
directionally.

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

github -> DBrianKimmel/PyHouse

Thanks
Brian
Pranav Bhardwaj | 17 Jul 02:58 2013
Picon

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

Hey

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:

        try:
            oStream = open(filename, 'wb')
            oStream.write(request.args['fname'][0])
            outputStream.close()

        except:
            # handle exception


a test client script:


<!DOCTYPE html>

<html>

<form action="https://serverUrl"

enctype="multipart/form-data"

method="post">

<div class="row">

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

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

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

</div>

</form>

</html>

_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Alexei Colin | 13 Jul 21:15 2013

Add response logging to logging-proxy.py example

Hello,

The example logging-proxy.py 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.

-alexei
Attachment (logging-proxy.py): text/x-python, 2377 bytes
_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
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.

http://zopache.com/ApacheNginxCherokeeTwistedWeb

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  ZTFY.org release of Zope 3.  But all things take time. 

Regards
Christopher Lozinski


_______________________________________________
Twisted-web mailing list
Twisted-web <at> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Tristan Seligmann | 2 Jul 16:25 2013
Picon

Re: Nginx vs Twisted Web

On Tue, Jul 2, 2013 at 3:25 PM, Richard Wall <m-lists <at> the-moon.net> 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> twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
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> imperial.ac.uk> 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 /
ZTFY.org web framework, or else
pyramid.  Pyramid is good for simpler applications, as they get more
complicated, I would recommend ztfy.org.  and wiki.ztfy.org

Better yet, just get a complete school application at

schooltool.org

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

Regards
Chris
http://zopache.com

Gmane