manually inject data into a site object
gary jefferson <[email protected]>
| Newsgroups | gmane.comp.python.twisted.web |
|---|---|
| Message-ID | <CAJcq2s0K=jttH18SE-SnfRXJaWmSrryZT2i-7Eb-uC=g2FWxHw@mail.gmail.com> |
I have a web service written in twisted-web. I have it running behind a NAT. I have a component (based on twisted Protocol) that makes a connection out from behind the NAT to a relay. Let's call this ReverseThing. Web clients can connect to the relay to send data back over this ReverseThing. Once I receive the data, how can I inject it directly into the web service? Assume both these services run in the same twisted process. Here's what I've tried: I can pass in the Site object to the ReverseThing protocol, so that I can call p=buildProtocol() on it, then I can call dataReceived() manually on that p. But obviously this doesn't work, because there isn't really a transport object to call things like getPeer() on. Is there some other way to send data to a Site, without it actually coming over the wire? Thanks, Gary