|
|
|
|
|
by acqq
4474 days ago
|
|
In Linux you can redirect the stdout to the the socket outside of your program, no programming required. You can test and develop everything with stdout and let the same unmodified file run in the web server. See traditional CGI, that's how dynamically generated web pages were easiest to implement long ago: http://computer.howstuffworks.com/cgi3.htm The server opens the socket, redirects the stdout to his socket while calling your program fully unmodified. |
|
As for serving files, you'd normally let nginx or apache take care of the sockets for you and not use output redirection.
In Plan9 it's actually viable to use network sockets as files which is pretty nice, but for Linux it's not really how people do it.