General TC > Programming & Scripting - Unofficial
socat httpd server
(1/1)
mocore:
the dasht project : https://github.com/sunaku/dasht - "Search API docs offline, in terminal or browser https://sunaku.github.io/dasht/man"
has an interesting server using socat and /bin/sh
https://github.com/sunaku/dasht/blob/master/bin/dasht-server
https://github.com/sunaku/dasht/blob/master/bin/dasht-server-http
a lot of other examples of similar sort of thing can be found on tha interwebz
eg another using socat and bash : https://gist.github.com/mbbx6spp/0ba0406afe65db556eef - "ZOMG a bash powers HTTP web service that runs via the `socat` web app container" :)
i search the forum and was surprised that
this minimal server method did not appear to be mentioned ! :o
and so now it has .
mocore:
Many possibility's exists for potential uses for this simple script server exist
Caching Server Scenario - http://forum.tinycorelinux.net/index.php/topic,4677.msg138694.html#msg138694
i just happened to find the one above while browsing the forum
its my intention to return to this thread at some point and post a simple example of how the above script/setup can be used/modified
but for now , in case it's not obvious it is requited to
--- Code: ---tce-load -i socat
--- End code ---
to run the scripts !!
another good/simple example use could be to create a fav-icon server
mocore:
a few more interesting examples
https://gitlab.com/girror-git-mirror/svr/shellscripthttpd - HTTPD written entirely in shell (works with Busybox)
and this one that requires bash
https://github.com/TooTallNate/bashttpd
which makes some interesting changes from its original fork
https://github.com/TooTallNate/bashttpd/commit/e46ca8994eba703a2ffb853c39599f0e5c0ef9b0 #Simplify things by using pipes instead of fds
https://github.com/TooTallNate/bashttpd/commit/1b79633adf7809dc2244c1c325bdea475cbb8dd4#Make stdin be the HTTP request body
* see also : http://forum.tinycorelinux.net/index.php/topic,22762.0.html# more shell !!
;D
(imho) it might be an interesting experiment to condense the functional style "pipes/stdin/stdout" ect of the ba shttpd and rework it to work with sh
like dasht or shellscripthttpd
could be ideal to create/host a local index.html of extensions
as was requested in http://forum.tinycorelinux.net/index.php/topic,22843.msg143165.html#msg143165# could we have a web-site index.html of extensions for tc10 64 and 32 bits?
Navigation
[0] Message Index
Go to full version