Simple HTTP server that will send the same file for all requests?

Posted by Rory McCann on Server Fault See other posts from Server Fault or by Rory McCann
Published on 2010-03-19T10:04:40Z Indexed on 2010/03/19 10:11 UTC
Read the original article Hit count: 228

Filed under:
|
|

I need to debug a XML-RPC application, which sends XML replies over HTTP. I have a sample XML reply (i.e. data from the server, sent to the client that isn't working), I'd like to debug my application. Ideally I'd like a simple HTTP server that will serve one file in reply to all requests. Someone requests /? Send them this file. Someone makes a post to /server/page.php with a certain cookie? Just send them this file. I don't care about multithreading, or security. I will only need to use this for a few hours to debug. I have root on the machine.

i.e. I'm hoping there's something as easy to use as this:

simple_http_server -p 12445 -f my_test_file

I'm aware of python's SimpleHTTPServer module, but I'm not sure how to make it work in this case.

© Server Fault or respective owner

Related posts about http

Related posts about command-line