~cadence/bliz

225f9f67443bb22257e1a277ec2cd4432a39cec3 — Cadence Ember 2 months ago d72ee61 main
Support and prefer ncat
2 files changed, 14 insertions(+), 2 deletions(-)

M README.md
M main.fish
M README.md => README.md +4 -1
@@ 19,7 19,10 @@
Dependencies:

- fish shell
- socat
- a TLS+TCP listener, choose one of:
  - [ncat](https://nmap.org/ncat): preferred! supports TLS 1.3 and TLS 1.2
    - note: ncat is _not_ the same as netcat, nc, openbsd-nc, or busybox nc
  - socat: works, but TLS 1.2 only

## About Bliz


M main.fish => main.fish +10 -1
@@ 3,4 3,13 @@
source src/config.fish
source src/includes.fish

socat openssl-listen:1965,cert=certs/cert.pem,key=certs/key.pem,verify=0,reuseaddr,fork exec:"fish src/cgi.fish"
if command -q ncat
    # ripped from https://git.sakamoto.pl/laudompat/http.sh/-/blob/master/http.sh#L182
    # ncat is better to use because it can do TLS 1.3, which some clients require.
    ncat -k -l 1965 -e '/usr/bin/env fish src/cgi.fish' --ssl --ssl-cert certs/cert.pem --ssl-key certs/key.pem
else if command -q socat
    socat 'openssl-listen:1965,cert=certs/cert.pem,key=certs/key.pem,method=TLS1.2,verify=0,reuseaddr,fork' 'exec:fish src/cgi.fish'
else
    echo 'either ncat or socat is required to run the TLS+TCP server.' >&2
    exit 1
end