Questions tagged [twisted.web]

Twisted Web provides a simple, stable HTTP server built on top of Twisted framework. It is suitable for all types of web apps and web services. It provides a flexible resource publishing API, and implements HTTP 1.0 with some 1.1 features. It can also be used for hosting WSGI applications.

199 questions
2
votes
1 answer

How to use Twisted Web static.File resource without cache?

I am using the Twisted Web static.File resource for the static part of the web server. For development I would like to be able to add new file or to modify the current static files without having the restart the Twisted web server. I am looking at…
Adi Roiban
  • 1,293
  • 2
  • 13
  • 28
2
votes
1 answer

I am not able to execute dash-plotly file with Twisted Web Server

Honestly, I am really stuck here. A colleague and I have been working on this for the past day or so and we don't know to get a python file working with Twisted Web. Twisted web is a stand-alone server with a built-in WSGI container, so I want to…
GusG
  • 363
  • 2
  • 4
  • 11
2
votes
2 answers

Python Twisted Daemon

I have written a simple twisted server - from twisted.internet import reactor from twisted.internet import protocol from twisted.web import server, resource from twisted.internet import reactor class Index(resource.Resource): isLeaf = True …
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
2
votes
1 answer

Writing excellent Twisted web Resources

I wrote my very first Twisted 10.1.0 web Resource and I am seeking for feedback, because I feel this isn't exactly following the best practice and may contain newbies bugs. The resource responds to /?url=http://www.foo.baz/abc123 and relies on a…
phretor
  • 57
  • 2
  • 9
2
votes
1 answer

variable substitution in python twisted static file

How can you substitute a twisted server variable into the file resource that is served out. For example, the following code serves up a webpage where i can go and load up ./templates/index.html : if __name__ == '__main__': var = 'my variable' …
user1601716
  • 1,893
  • 4
  • 24
  • 53
2
votes
2 answers

pyopenssl, twisted with let's encrypt: server's certificate chain is incomplete

I want to use let's encrypt on my twisted server, but on the latest Chrome for Android, I receive: the identity of this website has not been verified Similar message on the latest Firefox for Ubuntu. My SSL Report from ssllabs.com: This server's…
Mostafa
  • 1,501
  • 3
  • 21
  • 37
2
votes
1 answer

twisted.web.client HTTP logging

How can I log the HTTP requests and responses when using twisted.web.client? I've checked the docs and sources and didn't find anything but maybe it's possible using some custom agents or some such?
wRAR
  • 25,009
  • 4
  • 84
  • 97
2
votes
2 answers

How to use pycurl with Twisted Python?

I am writing an application using pycurl, and need to make it work in Twisted. I've been searching for either making pycurl somehow compatible with Twisted framework, or using an existing Twisted library. I am suggested Twisted web, but there is no…
Pippi
  • 2,451
  • 8
  • 39
  • 59
2
votes
1 answer

How to Loadbalance requests using Twisted Framework?

I have been using following twisted python script to listen for the requests on port 8080 and forward the request to specific IP. Here is the script: class ServerProtocol(protocol.Protocol): def __init__(self): self.buffer = None …
2
votes
2 answers

Templating and form processing toolkits to use with twisted.web

As the title states, I am looking for something, that will help me automate form processing (validation/rendering/etc) in twisted.web. I am also looking for a suitable templating toolkit to use with it. As for templating, it is not so much of an…
shylent
  • 10,076
  • 6
  • 38
  • 55
2
votes
1 answer

twisted Get response data at client

I followed this tutorial but I don't know how to get response data from server. class Service(Resource): def render_POST(self, request): return 'response message' I know that the response data will be displayed in the client def…
TomNg
  • 1,897
  • 2
  • 18
  • 25
2
votes
1 answer

Mocking Twisted web client HTTP requests using HTTPretty

As Httpretty works on the Python socket layer, even Twisted web requests should be mocked out. But i am seeing some weird behavior on using httpretty. It tries to connect to localhost somehow. Below example shows the difference: import…
prat0318
  • 571
  • 1
  • 8
  • 19
2
votes
1 answer

Twisted multiple concurrent or async streams

I'm writing an application in python using the twisted.web framework to stream video using html 5. The videos are being server via static.File('pathtovideo').render_GET() The problem is that only one video can be streamed at a time as it ties up the…
2
votes
1 answer

how to disconnect alive connections in twisted.server

How to enumerate and kill the kept-alive connections using twisted.web.server ? class Srv(Resource): isLeaf = True def __init__(self,port): self.listener = reactor.listenTCP(port, Site(self)) def shutdown(self): …
vrdhn
  • 4,024
  • 3
  • 31
  • 39
2
votes
1 answer

How to dump html string into a python twisted template

I'm making a website using twisted.web.template, where multiple pages have sub-windows with identical html code. So I want to use templates, and just dump a complete html string into place holders, wherever there is identical code. But it the…
funklute
  • 581
  • 4
  • 21