Showing posts with label web server. Show all posts
Showing posts with label web server. Show all posts

Monday, March 26, 2012

Python SimpleHTTPServer

I needed to do some test and share a file on different machine. Fortunately there is a very simple solution for what I need, which is using Python's SimpleHTTPServer.
What I needed to do is simply go to the directory where the file is and then execute the following command:

$ python -m SimpleHTTPServer

Executing above command without arguments will run the webserver on 0.0.0.0:8000.

For more information just click here.

Wednesday, December 21, 2011

netcat as WebServer

I needed to have a (dummy) web server which gives only 201 CREATED response, for testing purpose. Instead of using real web server, I found a simpler way to achieve that. Using netcat like the following is enough for me to do some testing on my programs.

$ nc -C -l 8080 -q 1 << EOF
HTTP/1.0 201 CREATED
Content-Type: text/html
EOF