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
0 answers
Sending multiple messages to a server with a twisted client
I know that this is a duplicate
Send multiple messages to server from twisted client, however the answers there don't really help and I still have questions on how to solve this issue.
To test, I wrote a simple echo server that just echos whatever…

Hanson Duan
- 19
- 1
0
votes
1 answer
How to assign a returned value from the defer method in python/twisted
I have a class, which is annotated as @defer.inlineCallbacks
(I want to return the machine list from this)
@defer.inlineCallbacks
def getMachines(self):
serverip = 'xx'
basedn = 'xx'
binddn = 'xx'
bindpw = 'xx'
…

Ratha
- 9,434
- 17
- 85
- 163
0
votes
0 answers
How can I render html file in twisted resource in python?
Currently i am doing this
from twisted.web.resource import Resource
class MyPostResource(Resource):
def render_GET(self, request):
html_file = open("form.html","rb")
html_file = html_file.readlines()
html_file =…

Syed Zeshan Ali
- 1
- 3
0
votes
1 answer
Twisted Session Cookie is Changing for Each Request
For some reason after logging in, every POST request afterwards the Twisted session cookie changes. Why does this happen? I would expect the session uid to be the same until the connection is lost, or the user logs out.
Here is my code that causes…

Brian
- 421
- 3
- 20
0
votes
1 answer
Twisted.web.server does not notify if a connection is cancelled by client
The documentation implies that the Deferred at request.notifyFinish() should be notified if the connection drops for any reason. I loaded similar code below:
from twisted.web.resource import Resource
from twisted.web.server import…

Matthew Scouten
- 15,303
- 9
- 33
- 50
0
votes
1 answer
Is there a "Chunk Received" callBack in twisted web
I've tried the render_GET, it would only be called when the whole chunk body in received and bufferd.
How can I get the partial trunk data? I need to handle the data continuous(like stream), it is a long-exists connection(>10 mins).
Can someone help…

Rex
- 76
- 10
0
votes
0 answers
Redirect to an instance of Twisted web server
We have a Twisted application running as a Windows Service, serving the web application on a given port, e.g. https://localhost:8880/portal, etc. Each Windows Service is configured to serve on a particular port.
We would like to be able to redirect…

codedog
- 2,488
- 9
- 38
- 67
0
votes
0 answers
Twisted - How can one expose a Protocol to the internet so it can be called via an HTTP POST?
So protocols allow asynchronous functionality but only on the TCP level.
from twisted.internet import reactor, protocol, endpoints
class UpperProtocol( protocol.Protocol ):
def connectionMade( self ):
self.transport.write( "Convet to…

Meghdeep Ray
- 5,262
- 4
- 34
- 58
0
votes
1 answer
Python Twisted: no module named web.server
I am trying to execute the following import command:
from twisted.web.server import NOT_DONE_YET
I am able to do it just fine in the interpreter, but when I execute it in a .py script, I get the error message:
ImportError: No module named…

user279043
- 111
- 1
0
votes
1 answer
Want to use Twisted web server on Heroku
I am new for Twisted web server and Heroku.
I want to use Twisted web server on Heroku
I use the client code like this
from twisted.internet import protocol, reactor
import os
class Knock(protocol.Protocol):
def dataReceived(self, data):
…

soysoy
- 289
- 2
- 10
0
votes
1 answer
Ruminations on highly-scalable and modular distributed server side architectures
Mine is not really a question, it's more of a call for opinions - and perhaps this isn't even the right place to post it. Nevertheless, the community here is very informed, and there's no harm in trying...
I was thinking about ways to create a…

David Semeria
- 542
- 3
- 15
0
votes
1 answer
Twisted - Twistar calling lastval() causing psycopg2 error
At the end of an insertion query, twistar calls lastval() and causes the postgres driver to fail.
2016-10-06 11:08:02+0200 [-] Log opened.
2016-10-06 11:08:02+0200 [-] MAIN: Starting the reactor
2016-10-06 11:08:02+0200 [-] TWISTAR query: SELECT *…

venturieffect
- 181
- 2
- 10
0
votes
3 answers
Twisted reactor blocks for long deferred tasks
I am working on a projects that involves making many requests to an api and for each feedback I am making a decision and saving in the db. I am using adbapi to communicate to mysql.
I am receiving the request as a POST containing a list of items…

Eutychus
- 442
- 8
- 12
0
votes
1 answer
Flask deployed with twistd: Failed to load application: 'NoneType' object has no attribute 'startswith'
I am trying to deploy my Twisted application using .tac files and twistd
I tried to deploy it with the command line:
twistd -y service.tac
I have the error:
...
application = getApplication(self.config, passphrase)
--- ---
…

Mostafa
- 1,501
- 3
- 21
- 37
0
votes
1 answer
How to stop Twisted callback?
I wrote a callback function using twisted Now my question is when websocket connection dropped I need to stop this callback.
def sendBack(self, payload):
# find correct way to identify connection dropped now using wasnotcl...
if…
user4079217