Quantcast
Channel: User Sergey Ponomarev - Stack Overflow
Viewing all articles
Browse latest Browse all 66

Answer by Sergey Ponomarev for Is there a way to get httpd to serve a simple string?

$
0
0

Sorry, it's not clear if you want to serve some string or to receive (i.e some API call?).The busybox httpd -f -p 8000 command starts the http server on port 8000 on all interfaces (including public) but don't go to background and you see logs of the server.

If you want to serve a string then you can create an index.html file and put the string there. The bb httpd will show the content of the index.html file by default when you open the site in browser.If the string should be dynamically taken from somewhere then you have to create a CGI script.Create a file ./cgi-bin/index.cgi, add a shebang and printf "Content-Type: plain/text\r\n\r\nsome string" and then make it executable. After opening the site the script will be executed and it's output will be returned to a browser.


Viewing all articles
Browse latest Browse all 66

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>