[Twisted-Python] WebConduit

Donovan Preston dp at twistedmatrix.com
Thu Aug 1 01:34:57 EDT 2002


I developed this as a proof of concept and several people have expressed
interest in seeing the implementation, so I thought I'd clean it up a little
and send it to the list.

The WebConduit is a project that I have been thinking about doing for
several years now. Basically, it allows users to interact with a MUD server
from a web page without any silly Java applets or frames that reload every 5
seconds.

It does rely heavily on JavaScript to work, specifically it relies on the
later browser's ability to have JavaScript affect the contents of the page
after it has loaded. It also uses a trick pioneered by KnowNow,
www.knownow.com, of opening a frame to a page on the server which the server
never finishes sending to the browser. Using this technique, the Twisted
server can push new JavaScript commands to this iframe in response to events
on the remote server, and these JavaScript commands can in turn affect the
DOM of the main page.

It also uses another iframe to send commands to the twisted server.
JavaScript can set the src attribute of the iframe and use GET parameters to
send arbitrary variables to Twisted. Since all three iframes are coming from
the same browser, the browser sends the same cookie with all three requests.
Each request on the server then has access to the same Session object, and
the three frames can communicate using this session object.

That's about it, I'm pretty proud of the result. Enhoy.

Donovan

P.s. Put the rpy, js, and html files in a directory served by twisted.web,
and put the py file on your PYTHONPATH somewhere.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/applefile
Size: 490 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/applefile
Size: 488 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0001.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0001.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/applefile
Size: 486 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0002.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0002.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/applefile
Size: 486 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0003.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0003.txt 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/applefile
Size: 489 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0004.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20020731/172c3f6a/attachment-0004.txt 


More information about the Twisted-Python mailing list