diff --git a/test-connect.sh b/test-connect.sh new file mode 100644 index 0000000..bc52347 --- /dev/null +++ b/test-connect.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +SOCAT_PID= + +cleanup_socat() { + if test ! -z "$SOCAT_PID"; then + kill "$SOCAT_PID" + fi +} + +ENCLAVE_CID=$(nitro-cli describe-enclaves | jq -r ".[0].EnclaveCID") +socat TCP4-LISTEN:3000,reuseaddr,fork VSOCK-CONNECT:$ENCLAVE_CID:3000 & +SOCAT_PID="$!" + +curl -k https://localhost:3000; echo + +trap cleanup_socat EXIT