[Twisted-Python] Custom webserver
Hi , I am trying to use twisted as a webserver that serves files only for requests from the localhost ie the desktop on which it is running by mapping localhost(127.0.0.1) to a domain pattern ( thru the hosts file on windows ) so that a particular type of URL is served from this webserver. Can anyone help me with these : 1) How do I refuse to serve any request from any other machine on the network ( external or internal ) ie is there any way of finding out from where the request originated ( or is it possible to use something like .htaccess ) . Currently the directory listing is exposed to any other machine that can access the machine. 2) It is easy to set up a web.tap file using mktap web --path <pathtoRootDirectory> to serve files but I dont want to map the URL to a path on disk directly. Is it possible to override the getChild function of static.File ( which is doing the publishing part ) so that certain components of the URL can be ignored or re-mapped to a different path on local storage. I tried using a .rpy but that seems to be ignored as I guess that given the --path argument mktap creates a root Resource which is used by the application. Thanks, E.Vijay Rao vijay@accellion.com http://www.accellion.com
On Mon, Jun 16, 2003 at 09:57:13AM +0530, Vijay Rao wrote:
I am trying to use twisted as a webserver that serves files only for requests from the localhost ie the desktop on which it is running by mapping localhost(127.0.0.1) to a domain pattern ( thru the hosts file on windows ) so that a particular type of URL is served from this webserver.
Easiest way is to make it bind to 127.0.0.1. There's currently no support in mktap web for this, though there really should be. -- :(){ :|:&};:
participants (2)
-
Tommi Virtanen
-
Vijay Rao