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.
Questions tagged [twisted.web]
199 questions
0
votes
1 answer
Post request with multiple parameters using Twisted Web Client
I would like to send a POST request with multiple parameters using Twisted Web Client :
image : image
metadata : json document with meta data
I need to use pure Twisted without external libraries like Treq and requests.
At the moment, I can send…

hotips
- 2,575
- 7
- 42
- 59
0
votes
0 answers
Pure python reverse proxy that handles chunking
Reverse proxy capable pure python webserver?
References twisted, and there is a great example for how to set up a reverse proxy, that appears to work. I could not find how to make the example collect all the chunks and send off an unchunked request…

AntonOfTheWoods
- 809
- 13
- 17
0
votes
1 answer
Updating old django/twisted python code
Well I have some old python code that seems to not work right, I have researched to the ends of the internet trying to find a fix.
def getURL(self, context):
# Make this an absolute URL- currently it's required for
# links placed in the RSS…

Justasic
- 1
- 1
0
votes
0 answers
Gunicorn python Klein
Use Klein for the server and want to run it via Gunicorn.
from klein import Klein
app = Klein()
@app.route('/')
def hello(request):
return "Hello, world!"
resource = app.resource
Working good in twistd -n web --class=twistdPlugin.resource but…

Максим Дихтярь
- 151
- 1
- 1
- 8
0
votes
0 answers
ImportError: No module named twisted.web
sslstrip -l 8080
Traceback (most recent call last):
File "/usr/local/bin/sslstrip", line 27, in
from twisted.web import http
ImportError: No module named twisted.web
Hi all, when i type the previous command line, i received that error. i have…

Strato-fortex
- 1
- 1
0
votes
1 answer
How to run twisted webapps within their own threads and not using twistd
I have a somewhat rich python application and do not want to restructure it just for the sake of exposing some http end-points. I simply want to expose them via a set of threads that listen via http on those ports.
There are a couple of questions…

WestCoastProjects
- 58,982
- 91
- 316
- 560
0
votes
1 answer
Twisted web server session matching/diagnosing
I have an existing web application using Python Twisted. The clients are embedded devices rather than humans. So I occasionally run into quirks of the often outdated and simplistic http clients in these devices. The application relies on session…

Paul Hayes
- 31
- 1
0
votes
2 answers
How can I make my Twisted 'reactor' stop?
hoping you can figure out why my reactor won't stop? In my thread constructor I have tried reactor.startRunning(False) and reactor.run(). In the run command for this thread I use reactor.iterate() periodically and then have tried reactor.stop() and…

Milan Lakhani
- 371
- 1
- 2
- 15
0
votes
0 answers
Python Twisted Authentication Without HTTP Authentication
I'm setting up a Flask server, and want to use a Twisted ReverseProxyResource to proxy over another local server. In Flask, I have a current_user.is_authenticated boolean which I use to protect pages. How can I lock the ReverseProxyResource using…

Jordan Mann
- 402
- 6
- 16
0
votes
1 answer
How can I set custom headers for error responses from Twisted server?
In particular, I want to add CORS headers for 4xx and 5xx so my frontend webapp can display error info to the user.
In my application I have a root resource and I use putChild to add leaf resources. E.g.:
root = Root()
proxy =…

davegravy
- 888
- 11
- 28
0
votes
1 answer
Basic HTTP authentication with twisted not working
I have the following code:
import sys
from zope.interface import implementer
from twisted.python import log
from twisted.internet import reactor
from twisted.web import server, resource, guard
from twisted.cred.portal import IRealm, Portal
from…

DTT
- 39
- 5
0
votes
1 answer
How to define paths with multiple segments in Twisted web server
In a Twisted web server similar to this example code
from twisted.web.server import Site
from twisted.web.resource import Resource
from twisted.internet import reactor, endpoints
from twisted.web.static import File
root =…

glaucon
- 8,112
- 9
- 41
- 63
0
votes
0 answers
Twisted man in the middle proxy headers
Trying to read headers in twisted middle proxy server.
Here you can see simple twisted server (stolen from stackoverflow, yeah...). It nicely works, but I need to switch proxies based on request headers. Can't understand where I can get headers…

KaronatoR
- 2,579
- 4
- 21
- 31
0
votes
1 answer
storing data in twisted session
I am working to convert example code from Flask to twisted. The flask program is storing data in a session like so:
session['samlUserdata'] = self.auth.get_attributes()
session['samlNameId'] = self.auth.get_nameid()
session['samlSessionIndex'] =…

user1601716
- 1,893
- 4
- 24
- 53
0
votes
1 answer
twisted render_GET redirect to function
I can't seem to find any documentation on how to use twisted.web.util.Redirect to redirect to another function.
For more information see below.
I have the following code:
class Login(Resource):
isLeaf = True
def getChild(self, name,…

user1601716
- 1,893
- 4
- 24
- 53