• Re: Chris' little embedded web server

    From Mr. Man-wai Chang@3:633/10 to All on Mon Jun 15 14:17:38 2026
    On 6/13/2026 3:21 AM, Chris M. Thomasson wrote:

    Fwiw, around 25+ years ago in several of my proxy servers, I coded up a little embedded web server. It listened on a special port where I could
    go in and alter settings, see status, ect using a browser. I never coded
    up a GUI using Windows for it.

    Iirc, I also had another port where I could telnet into it and issue commands.


    And is the server multi-threading? Did it leak memory? :)

    Will you disclose its source codes in GitHub?

    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw

    --- PyGate Linux v1.5.16
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Jun 15 00:28:36 2026
    On 6/14/2026 11:17 PM, Mr. Man-wai Chang wrote:
    On 6/13/2026 3:21 AM, Chris M. Thomasson wrote:

    Fwiw, around 25+ years ago in several of my proxy servers, I coded up a
    little embedded web server. It listened on a special port where I could
    go in and alter settings, see status, ect using a browser. I never coded
    up a GUI using Windows for it.

    Iirc, I also had another port where I could telnet into it and issue
    commands.


    And is the server multi-threading? Did it leak memory? :)

    It was multi threading and it leaked nothing. No memory, a handle,
    ect... Well, the only shit storm that could occur when I turned off the limits... Well, Windows NT non-paged memory pool. If that ran out, shit
    could occur. Well, Windows has a neat way to try to take some pressure
    off. A Zero byte recv. So, a WSARecv in flight uses no non-paged memory.
    It would complete on IOCP. I would check its per-io flags, and say okay.
    Not its time to read the data that is ready. The trick was to not use non-paged while the io completion was in flight.

    Will you disclose its source codes in GitHub?

    Iirc wrote about some bits and pieces of it way back in iirc,
    alt.winsock. Its long ago. Actually, I think I might have a hd in my
    storage unit that has my win nt proxy server code.

    --- PyGate Linux v1.5.16
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mr. Man-wai Chang@3:633/10 to All on Mon Jun 15 18:37:52 2026
    On 6/15/2026 3:33 PM, Chris M. Thomasson wrote:
    On 6/14/2026 10:50 PM, Mr. Man-wai Chang wrote:

    Did you re-use your "little embedded web server" in other projects? Did
    it become a part of something bigger?

    I used it for many things personally. Actually, on some consulting jobs,
    I showed it to some people, some used parts of it. It was more like a
    proxy server framework. All in C. But, most of them were way more
    interested in me helping them fix some deadlocks and/or potential race conditions in their code. This was way back in very early 2000's.

    One of the worst jobs I ever had was for somebody who would lock a mutex
    in their io threads loop and call into user code. They said it was fine because of recursive mutex, but they also said it would deadlock from
    time to time. It was a fucking nightmare.


    I have never ever written a server app before, just business-oriented
    MIS stuffs (mostly Foxpro/DOS, Foxpro/Windows and Visual Foxpro). The
    last time I wrote things related directly to networked operating system
    was Novell Netware.

    I think I could call and respect you as a software engineeer? :)


    --

    @~@ Simplicity is Beauty! Remain silent! Drink, Blink, Stretch!
    / v \ May the Force and farces be with you! Live long and prosper!!
    /( _ )\ https://sites.google.com/site/changmw/
    ^ ^ https://github.com/changmw/changmw

    --- PyGate Linux v1.5.16
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Mon Jun 15 15:24:01 2026
    On 6/15/2026 3:37 AM, Mr. Man-wai Chang wrote:
    On 6/15/2026 3:33 PM, Chris M. Thomasson wrote:
    On 6/14/2026 10:50 PM, Mr. Man-wai Chang wrote:

    Did you re-use your "little embedded web server" in other projects? Did
    it become a part of something bigger?

    I used it for many things personally. Actually, on some consulting jobs,
    I showed it to some people, some used parts of it. It was more like a
    proxy server framework. All in C. But, most of them were way more
    interested in me helping them fix some deadlocks and/or potential race
    conditions in their code. This was way back in very early 2000's.

    One of the worst jobs I ever had was for somebody who would lock a mutex
    in their io threads loop and call into user code. They said it was fine
    because of recursive mutex, but they also said it would deadlock from
    time to time. It was a fucking nightmare.


    I have never ever written a server app before, just business-oriented
    MIS stuffs (mostly Foxpro/DOS, Foxpro/Windows and Visual Foxpro). The
    last time I wrote things related directly to networked operating system
    was Novell Netware.

    I think I could call and respect you as a software engineeer? :)



    Yeah. I am. thank you. But the last time I created server code was many
    moons ago. 20-25+ years ago. I moved to another place since then, around
    2012. Coding up fractals and vector fields. Fwiw, I made the 2025 AMS Calander. The cover! And the month of February. Fwiw, check this out.
    Can you get to the damn FB link?

    https://www.facebook.com/share/p/18nU7hiMYy/

    You can also find some of my work on YouTube. Fwiw, I also made the MIDI
    music here:

    https://youtu.be/HwIkk9zENcg

    https://youtu.be/n13GHyYEfLA



    --- PyGate Linux v1.5.16
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Jun 17 07:30:33 2026
    On Mon, 15 Jun 2026 18:37:52 +0800, Mr. Man-wai Chang wrote:

    I have never ever written a server app before ...

    How hard is it to write an HTTP server? Here <https://github.com/python/cpython/blob/main/Lib/http/server.py> is a
    pretty functional one (HTTP/1.1 only, no SSL/TLS, but with threading
    support) in under 1200 lines of code.

    --- PyGate Linux v1.5.17
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Mario Rosell@3:633/10 to All on Wed Jun 17 17:21:16 2026
    | How hard is it to write an HTTP server?

    It really depends on the language, but since this is comp.lang.c, I'll
    assume C: a lot. The Berkley socket API is absolute MADNESS to use!
    (at-at least for me...)

    | Here
    | <https://github.com/python/cpython/blob/main/Lib/http/server.py> is a
    | pretty functional one (HTTP/1.1 only, no SSL/TLS, but with threading
    | support) in under 1200 lines of code.

    On Python it's very easy, the stdlib's HTTP implementation is very nice
    to use and it even has a built in CGIHTTPRequestHandler request handling thingy, plus a nice `ssl` library without any SSL_CTX or BIO or all the boilerplate.

    --
    - mario

    --- PyGate Linux v1.5.17
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris M. Thomasson@3:633/10 to All on Wed Jun 17 12:06:23 2026
    On 6/17/2026 12:30 AM, Lawrence D?Oliveiro wrote:
    On Mon, 15 Jun 2026 18:37:52 +0800, Mr. Man-wai Chang wrote:

    I have never ever written a server app before ...

    How hard is it to write an HTTP server?

    vs creating a highly scalable and robust one?

    Here
    <https://github.com/python/cpython/blob/main/Lib/http/server.py> is a
    pretty functional one (HTTP/1.1 only, no SSL/TLS, but with threading
    support) in under 1200 lines of code.


    --- PyGate Linux v1.5.17
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Wed Jun 17 23:45:06 2026
    On Wed, 17 Jun 2026 12:06:23 -0700, Chris M. Thomasson wrote:

    On 6/17/2026 12:30 AM, Lawrence D?Oliveiro wrote:

    On Mon, 15 Jun 2026 18:37:52 +0800, Mr. Man-wai Chang wrote:

    I have never ever written a server app before ...

    How hard is it to write an HTTP server?

    Here
    <https://github.com/python/cpython/blob/main/Lib/http/server.py> is
    a pretty functional one (HTTP/1.1 only, no SSL/TLS, but with
    threading support) in under 1200 lines of code.

    vs creating a highly scalable and robust one?

    Scalable, subclassable, mixin-able ... remember Python does multiple inheritance.

    <https://docs.python.org/3/library/http.server.html>

    I was wrong -- it does offer the option of SSL/TLS. Building on
    another standard Python library module, of course.

    --- PyGate Linux v1.5.17
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)