[Twisted-Python] WebConduit
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.
participants (1)
-
Donovan Preston