forked from ihciah/shadow-tls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·73 lines (59 loc) · 1.11 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
parameter=""
if [ ! -z "$THREADS" ]
then
parameter="$parameter --threads $THREADS"
fi
if [ ! -z "$DISABLE_NODELAY" ]
then
parameter="$parameter --disable-nodelay"
fi
if [ ! -z "$FASTOPEN" ]
then
parameter="$parameter --fastopen"
fi
if [ ! -z "$V3" ]
then
parameter="$parameter --v3"
fi
if [ ! -z "$STRICT" ]
then
parameter="$parameter --strict"
fi
if [ "$MODE" = "server" ]
then
parameter="$parameter $MODE"
if [ ! -z "$TLS" ]
then
parameter="$parameter --tls $TLS"
fi
if [ ! -z "$WILDCARD_SNI" ]
then
parameter="$parameter --wildcard-sni $WILDCARD_SNI"
fi
fi
if [ "$MODE" = "client" ]
then
parameter="$parameter $MODE"
if [ ! -z "$TLS" ]
then
parameter="$parameter --sni $TLS"
fi
if [ ! -z "$ALPN" ]
then
parameter="$parameter --alpn $ALPN"
fi
fi
if [ ! -z "$SERVER" ]
then
parameter="$parameter --server $SERVER"
fi
if [ ! -z "$LISTEN" ]
then
parameter="$parameter --listen $LISTEN"
fi
if [ ! -z "$PASSWORD" ]
then
parameter="$parameter --password $PASSWORD"
fi
exec shadow-tls $parameter