Skip to content

Commit

Permalink
Fixes kcptun with ipv6 address.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuyuzhou committed Oct 11, 2019
1 parent 74c986c commit ec771d5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ShadowsocksX-NG/kcptun/kcptun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,18 @@ PLUGIN_BINARY_NAME="client"

CMD="$(dirname "${BASH_SOURCE[0]}")/../${PLUGIN_NAME}_${PLUGIN_VERSION}/${PLUGIN_BINARY_NAME}"

if [[ $SS_REMOTE_HOST == *":"* ]]; then
SS_REMOTE_ADDR="[${SS_REMOTE_HOST}]:${SS_REMOTE_PORT}"
else
SS_REMOTE_ADDR="${SS_REMOTE_HOST}:${SS_REMOTE_PORT}"
fi

if [[ $SS_LOCAL_HOST == *":"* ]]; then
SS_LOCAL_ADDR="[${SS_LOCAL_HOST}]:${SS_LOCAL_PORT}"
else
SS_LOCAL_ADDR="${SS_LOCAL_HOST}:${SS_LOCAL_PORT}"
fi

# Update this line when adapted other plugin.
"$CMD" -r "${SS_REMOTE_HOST}:${SS_REMOTE_PORT}" -l "${SS_LOCAL_HOST}:${SS_LOCAL_PORT}" ${OPTS[@]}
# echo -r "${SS_REMOTE_ADDR}" -l "${SS_LOCAL_ADDR}" ${OPTS[@]}
"$CMD" -r "${SS_REMOTE_ADDR}" -l "${SS_LOCAL_ADDR}" ${OPTS[@]}

0 comments on commit ec771d5

Please sign in to comment.