WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: socat httpd server  (Read 5256 times)

Offline mocore

  • Hero Member
  • *****
  • Posts: 730
  • ~.~
socat httpd server
« on: April 20, 2019, 03:42:07 PM »
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 .



« Last Edit: April 20, 2019, 03:46:11 PM by mocore »

Offline mocore

  • Hero Member
  • *****
  • Posts: 730
  • ~.~
Re: socat httpd server
« Reply #1 on: April 21, 2019, 09:08:10 AM »
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: [Select]
tce-load -i socat
to run the scripts !!


another good/simple example use could be to create a fav-icon server

« Last Edit: April 21, 2019, 09:14:16 AM by mocore »

Offline mocore

  • Hero Member
  • *****
  • Posts: 730
  • ~.~
Re: socat httpd server
« Reply #2 on: August 09, 2019, 02:25:44 PM »
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?




 
« Last Edit: August 09, 2019, 02:36:55 PM by mocore »

Offline gadget42

  • Hero Member
  • *****
  • Posts: 966
Re: socat httpd server
« Reply #3 on: October 09, 2025, 10:12:23 AM »
didn't want to start a new thread for a couple of links

https://docs.github.com/en/pages

https://docs.gitlab.com/user/project/pages/
** WARNING: connection is not using a post-quantum kex exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html

Offline mocore

  • Hero Member
  • *****
  • Posts: 730
  • ~.~
Re: socat httpd server
« Reply #4 on: October 12, 2025, 07:06:59 AM »
didn't want to start a new thread for a couple of links

fair enough i guess ... however
.. what *would you* have called the thread if you did  ??
...what they might have to do with (honestly struggling to find relevance)
scripted-http-d idk tbh
most if not all the other links are
socat (or similar) + server.sh(or similar)

these are *some* enterprise http hosting a *service*
with a web gui you could host "pages" on  ???


https://docs.github.com/en/pages

https://docs.gitlab.com/user/project/pages/

Offline mocore

  • Hero Member
  • *****
  • Posts: 730
  • ~.~
Re: socat httpd server
« Reply #5 on: October 12, 2025, 09:31:40 AM »
fwiw http and other svc hosting can be found on some of the links mention in
"Public Access *NIX System(s)" @
https://forum.tinycorelinux.net/index.php/topic,25400.msg162365.html#msg162365


(honestly struggling to find relevance)
...
these are *some* enterprise http hosting a *service*
with a web gui you could host "pages" on  ???


unless your point was you it would be possible to create a similar web-ui locally on a socat-httpd !?
« Last Edit: October 12, 2025, 09:34:45 AM by mocore »