sdomi changed the topic of #http.sh to: the coolest web framework (in Bash) to date :: logs: https://libera.irclog.whitequark.org/http.sh/ :: contributions welcome <3
<sdomi> god dammit, computers
<sdomi> so with httpsh we're using ncat for the actual "listening on a socket" part
<sdomi> this has the `-k` option, the connection broKer. it tells it to keep listening after the first connection
<sdomi> now. TCP is garbage, and it's a fact of life that a client may disconnect, yet a connection will linger for the server (or vice versa). That's what we have timeouts for
<sdomi> ncat also has the `-i` option, the Idle timer. set it to a value in seconds, get angry when it tries to be smug and tells you "you put in an unusually large value. this used to mean ms, now it means seconds, are you sure you want that?" and exits, add an `s` prefix, done
<sdomi> s/prefix/postfix/
<sdomi> if ncat was a corporate product, I'd say that the team from `-k` and the team from `-i` never talked to each other, because `-i` doesn't kill the connection - it exits the program, even if it's running in the broker mode
<sdomi> for the longest time we've had a workaround for this, just slap ncat in a while true. only had a few issues with it over the last 5 years
<sdomi> unfortunately, there's this thing called WebSockets, which *is supposed to be long-lived*. So if something kills the ncat process via the idle timeout while you have a healthy websocket running... you're f-ed, it will go into a restart loop, not being able to start another ncat instance until that random ws exits
<sdomi> there are ways to mitigate this, of course. I'm gonna migrate from using `-i` to read timeouts. not sure about the websockets and terminating those, guess i'll need to do some sort of hack?
<sdomi> this is quite infuriating