#!/usr/bin/env bash

set -exu
__DIR__=$(
  cd "$(dirname "$0")"
  pwd
)
cd ${__DIR__}

curl -fSL  https://gitee.com/jingjingxyk/swoole-cli/raw/new_dev/setup-socat-runtime.sh | bash -s -- --mirror china

DOMAIN='tls.proxy.dengxiaci.com'
./bin/runtime/socat -d -d TCP4-LISTEN:8016,reuseaddr,fork ssl:${DOMAIN}:8015,verify=1,\
snihost=${DOMAIN},commonname=${DOMAIN},\
openssl-min-proto-version=TLS1.3,openssl-max-proto-version=TLS1.3,cafile=./bin/runtime/cacert.pem
