Skip to content

Commit

Permalink
dialer: remove the bad alias socks4:// for socks4a://
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <[email protected]>
  • Loading branch information
hexian000 committed Nov 10, 2024
1 parent 2ec952a commit 7c12f0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions m.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ case "$1" in
rm -rf "build" && mkdir "build"
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static-libgcc" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-S "." -B "build"
cmake --build "build"
HOST="$(cc -dumpmachine)"
Expand Down Expand Up @@ -106,7 +106,6 @@ case "$1" in
cmake \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DLINK_STATIC_LIBS=ON \
-S . -B "build"
cmake --build "build"
(cd "build/bin" && objdump -drwS "neosocksd" >"neosocksd.S")
Expand All @@ -117,7 +116,6 @@ case "$1" in
rm -rf "build" && mkdir -p "build"
cmake \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DCMAKE_BUILD_TYPE="Release" \
-S . -B "build"
cp build/compile_commands.json compile_commands.json
Expand Down
8 changes: 3 additions & 5 deletions src/dialer.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,19 @@ bool dialreq_addproxy(
}
enum proxy_protocol protocol;
char *host, *port;
if (strcmp(uri.scheme, "http") == 0) {
if (strcmp(uri.scheme, proxy_protocol_str[PROTO_HTTP]) == 0) {
protocol = PROTO_HTTP;
if (!splithostport(uri.host, &host, &port)) {
host = uri.host;
port = "80";
}
} else if (
strcmp(uri.scheme, "socks4") == 0 ||
strcmp(uri.scheme, "socks4a") == 0) {
} else if (strcmp(uri.scheme, proxy_protocol_str[PROTO_SOCKS4A]) == 0) {
protocol = PROTO_SOCKS4A;
if (!splithostport(uri.host, &host, &port)) {
host = uri.host;
port = "1080";
}
} else if (strcmp(uri.scheme, "socks5") == 0) {
} else if (strcmp(uri.scheme, proxy_protocol_str[PROTO_SOCKS5]) == 0) {
protocol = PROTO_SOCKS5;
if (!splithostport(uri.host, &host, &port)) {
host = uri.host;
Expand Down

0 comments on commit 7c12f0e

Please sign in to comment.