BASE="http://127.0.0.1:8006"
curl -s -N -m 15 -H 'Host: localhost:8006' "$BASE/sse" > /tmp/sse6.txt &
CP=$!
sleep 2
SID=$(grep -oP 'session_id=\K[^/]+' /tmp/sse6.txt | head -1)
echo SID=$SID
curl -sv -m 4 -X POST "$BASE/messages/?session_id=$SID" -H 'Host: localhost:8006' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' 2>&1 | grep -E '^< HTTP|< Content-Type|^< ' | head -8
sleep 2
kill $CP 2>/dev/null
