mirror of
https://github.com/samuelhbne/server-xray.git
synced 2025-12-17 20:34:39 +03:00
Default server port 443
This commit is contained in:
@@ -4,6 +4,8 @@ usage() {
|
||||
echo "Usage: server-lpg <x=xray-config-file>,<p=listen-port>,<u=xxx-xxx[:0[:a@mail.com]]>,<s=svcname>"
|
||||
}
|
||||
|
||||
port=443
|
||||
|
||||
options=(`echo $1 |tr ',' ' '`)
|
||||
for option in "${options[@]}"
|
||||
do
|
||||
@@ -30,8 +32,10 @@ if [ -z "${xconf}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=443
|
||||
if [ -z "${service}" ]; then
|
||||
echo "Error: service name undefined."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
@@ -74,6 +78,10 @@ cat $XCONF |jq --arg port "${port}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .settings.decryption ) += "none" ' \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" --arg service "${service}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"network":"grpc", "grpcSettings":{"serviceName":$service}, "security":"none"} ' \
|
||||
cat $XCONF |jq --arg port "${port}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"network":"grpc", "security":"none" } ' \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" --arg service "${service}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"grpcSettings":{"serviceName":$service}} ' \
|
||||
|sponge $XCONF
|
||||
|
||||
@@ -4,6 +4,8 @@ usage() {
|
||||
echo "Usage: server-lps <x=xray-config-file>,<p=listen-port>,<u=myid[:0[:a@mail.com]]>,<w=web-path>"
|
||||
}
|
||||
|
||||
port=443
|
||||
|
||||
options=(`echo $1 |tr ',' ' '`)
|
||||
for option in "${options[@]}"
|
||||
do
|
||||
@@ -33,10 +35,6 @@ if [ -z "${xconf}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=443
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
echo "Error: user undefined."
|
||||
usage
|
||||
|
||||
@@ -4,6 +4,8 @@ usage() {
|
||||
echo "Usage: server-lpw <x=xray-config-file>,<p=listen-port>,<u=myid[:0[:a@mail.com]]>,<w=websocket-path>"
|
||||
}
|
||||
|
||||
port=443
|
||||
|
||||
options=(`echo $1 |tr ',' ' '`)
|
||||
for option in "${options[@]}"
|
||||
do
|
||||
@@ -33,10 +35,6 @@ if [ -z "${xconf}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=443
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
echo "Error: user undefined."
|
||||
usage
|
||||
|
||||
@@ -4,6 +4,8 @@ usage() {
|
||||
echo "Usage: server-mpw <x=xray-config-file>,<p=listen-port>,<u=myid[:0[:a@mail.com]]>,<w=websocket-path>"
|
||||
}
|
||||
|
||||
port=443
|
||||
|
||||
options=(`echo $1 |tr ',' ' '`)
|
||||
for option in "${options[@]}"
|
||||
do
|
||||
@@ -33,10 +35,6 @@ if [ -z "${xconf}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=443
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
echo "Error: user undefined."
|
||||
usage
|
||||
|
||||
@@ -4,6 +4,8 @@ usage() {
|
||||
echo "Usage: server-tpw <x=xray-config-file>,<p=listen-port>,<u=password[:level[:email]],<w=websocket-path>"
|
||||
}
|
||||
|
||||
port=443
|
||||
|
||||
options=(`echo $1 |tr ',' ' '`)
|
||||
for option in "${options[@]}"
|
||||
do
|
||||
@@ -33,10 +35,6 @@ if [ -z "${xconf}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${port}" ]; then
|
||||
port=443
|
||||
fi
|
||||
|
||||
if [ -z "${xuser}" ]; then
|
||||
echo "Error: user undefined."
|
||||
usage
|
||||
@@ -126,10 +124,6 @@ cat $XCONF |jq --arg port "${port}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"network":"ws", "security":"none" } ' \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"tlsSettings":{"alpn":["http/1.1"]} } ' \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" --arg wspath "${wspath}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"wsSettings":{"path":$wspath}} ' \
|
||||
|sponge $XCONF
|
||||
|
||||
@@ -145,7 +145,7 @@ cat $XCONF |jq --arg port "${port}" \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"tlsSettings":{"alpn":["http/1.1"]} } ' \
|
||||
'( .inbounds[] | select(.port == ($port|tonumber)) | .streamSettings ) += {"tlsSettings":{"alpn":["h2,http/1.1"]} } ' \
|
||||
|sponge $XCONF
|
||||
|
||||
cat $XCONF |jq --arg port "${port}" --arg wspath "${wspath}" \
|
||||
|
||||
@@ -9,6 +9,8 @@ server {
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
add_header Alt-Svc 'h3=":443"; ma=86400';
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
client_header_timeout 1071906480m;
|
||||
keepalive_timeout 1071906480m;
|
||||
|
||||
Reference in New Issue
Block a user