From 8b99bd56f4985ae60315dd842dec5a250b774e33 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 15:58:33 +0300 Subject: [PATCH 01/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1660739..2f82289 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -2,10 +2,10 @@ name: C/C++ CI on: push: - branches: [ "master" ] + branches: [ "test-ci" ] paths: [ '**.c', '**.h', 'Makefile.**', '.github/configs', '.github/workflows/c-cpp.yml' ] pull_request: - branches: [ "master" ] + branches: [ "test-ci" ] paths: [ '**.c', '**.h', 'Makefile.**', '.github/configs', '.github/workflows/c-cpp.yml' ] jobs: @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC"' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From 3facfb815cc0377fcde63d30da002d7974ff356c Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 16:00:04 +0300 Subject: [PATCH 02/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 2f82289..6441e33 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC"' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64"' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From be1366d0ee1a62cf26e3b4e4c15dc7820dfd0de2 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 16:13:38 +0300 Subject: [PATCH 03/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 6441e33..b380a06 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64"' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64" && pacman -S openssl-devel ' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From 3fa87fae668d4ff7b5ec8fda42bfd6228cd54cc8 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 16:15:10 +0300 Subject: [PATCH 04/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b380a06..ce640a9 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64" && pacman -S openssl-devel ' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64" && dir "c:/mingw64/lib" ' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From 2df2993605384aaa0680611801ac4659b8629603 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 16:17:05 +0300 Subject: [PATCH 05/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index ce640a9..70fc1ff 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64" && dir "c:/mingw64/lib" ' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64/MT" && dir "c:/mingw64/lib/" ' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From 0f024b136e2fcbfa90101a228408bcd52329f218 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 17 Nov 2025 16:18:41 +0300 Subject: [PATCH 06/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 70fc1ff..e5d6205 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -34,7 +34,7 @@ jobs: run: copy Makefile.win Makefile - name: dirs Windows if: ${{ startsWith(matrix.target, 'windows') }} - run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64/MT" && dir "c:/mingw64/lib/" ' + run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib/VC/x64/MT" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && dir "c:/program files/openssl/lib/VC/x64/MT" && dir "c:/mingw64/lib/" ' - name: SSLPlugin Linux if: ${{ startsWith(matrix.target, 'ubuntu') }} run: "sed -i '/^PLUGIN/s/$/ SSLPlugin/' Makefile && sed -i '/^LIBS/s/$/ -lcrypto -lssl/' Makefile" From a4b09e16fc55a11135f02a7604599db0ab0d6e53 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:09:43 +0300 Subject: [PATCH 07/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index df03d32..7a3889e 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -70,6 +70,8 @@ jobs: D: cd "D:/a/3proxy/3proxy" vcpkg install pcre2:x64-windows + dir /S c:/program files/openssl/lib/ + dir c:/vcpkg/installed/x64-windows/lib mkdir bin64 set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" nmake /F Makefile.msvc64 From eb85c03ed00bfeaa22b4e47685254b4da6acaa24 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:14:53 +0300 Subject: [PATCH 08/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7a3889e..4bd9ceb 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -70,8 +70,8 @@ jobs: D: cd "D:/a/3proxy/3proxy" vcpkg install pcre2:x64-windows - dir /S c:/program files/openssl/lib/ - dir c:/vcpkg/installed/x64-windows/lib + dir /S "c:\program files\openssl\lib\" + dir "c:\vcpkg\installed\x64-windows\lib" mkdir bin64 set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" nmake /F Makefile.msvc64 From 0f43f992ac43c3d46bd25504dd52077ed7b062ad Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:26:30 +0300 Subject: [PATCH 09/22] rollback changes in SSLPlugin makefile --- .github/workflows/c-cpp.yml | 6 +++--- Makefile.FreeBSD | 3 ++- Makefile.Linux | 1 + Makefile.msvc | 3 ++- Makefile.msvc64 | 5 +++-- Makefile.msvcARM64 | 2 +- Makefile.openwrt-mips | 3 +++ Makefile.unix | 1 + Makefile.win | 1 + src/plugins/SSLPlugin/Makefile.inc | 2 +- 10 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 4bd9ceb..64879dc 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -73,9 +73,9 @@ jobs: dir /S "c:\program files\openssl\lib\" dir "c:\vcpkg\installed\x64-windows\lib" mkdir bin64 - set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" + set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT" nmake /F Makefile.msvc64 nmake /F Makefile.msvc64 clean env: - CFLAGS: '-I "c:/program files/openssl/include" -I "c:/vcpkg/installed/x64-windows/include"' - + LIBS: '/LIBPATH:"c:/program files/openssl/lib/VC/x64/MT"' + CFLAGS: '-I "c:/program files/openssl/include"' diff --git a/Makefile.FreeBSD b/Makefile.FreeBSD index 3854b3a..49c6bae 100644 --- a/Makefile.FreeBSD +++ b/Makefile.FreeBSD @@ -15,8 +15,8 @@ LDFLAGS += -pthread -fno-strict-aliasing # -ldl or -lld may be required for some platforms DCFLAGS ?= -fPIC DLFLAGS ?= -shared -LIBS ?= DLSUFFICS = .so +LIBS ?= LIBSPREFIX = -l LIBSSUFFIX = LNOUT = -o @@ -32,6 +32,7 @@ MAKEFILE = Makefile.FreeBSD PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin OPENSSL_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false) ifeq ($(OPENSSL_CHECK), true) + LIBS += -l crypto -l ssl PLUGINS += SSLPlugin endif PAM_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false) diff --git a/Makefile.Linux b/Makefile.Linux index 7681b4f..732c0f2 100644 --- a/Makefile.Linux +++ b/Makefile.Linux @@ -38,6 +38,7 @@ LIBS ?= -ldl PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin OPENSSL_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false) ifeq ($(OPENSSL_CHECK), true) + LIBS += -l crypto -l ssl PLUGINS += SSLPlugin endif PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) diff --git a/Makefile.msvc b/Makefile.msvc index 7d8a63e..5affb31 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -14,7 +14,8 @@ LN = link LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 DLFLAGS = /DLL DLSUFFICS = .dll -LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib +LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib libcrypto.lib libssl.lib +LIBSOLD = libeay32MT.lib ssleay32MT.lib LIBSPREFIX = LIBSSUFFIX = .lib LIBEXT = .lib diff --git a/Makefile.msvc64 b/Makefile.msvc64 index dc8a00a..3d2fbe1 100644 --- a/Makefile.msvc64 +++ b/Makefile.msvc64 @@ -16,7 +16,8 @@ LN = link LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64 DLFLAGS = /DLL DLSUFFICS = .dll -LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib $(LIBS) +LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib libcrypto.lib libssl.lib $(LIBS) +LIBSOLD = libeay32.lib ssleay32.lib LIBSPREFIX = LIBSSUFFIX = .lib LIBEXT = .lib @@ -30,7 +31,7 @@ TYPECOMMAND = type COMPATLIBS = VERFILE = 3proxy.res $(VERFILE) VERSIONDEP = 3proxy.res $(VERSIONDEP) -PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin PCREPlugin +PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin AFTERCLEAN = del src\*.res include Makefile.inc diff --git a/Makefile.msvcARM64 b/Makefile.msvcARM64 index bda64bc..a892c0d 100644 --- a/Makefile.msvcARM64 +++ b/Makefile.msvcARM64 @@ -14,7 +14,7 @@ LN = link LDFLAGS = /nologo /subsystem:console /incremental:no /machine:arm64 DLFLAGS = /DLL DLSUFFICS = .dll -LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib +LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libcrypto.lib libssl.lib LIBSOLD = LIBSPREFIX = LIBSSUFFIX = .lib diff --git a/Makefile.openwrt-mips b/Makefile.openwrt-mips index 2181bb2..0cbe8f0 100644 --- a/Makefile.openwrt-mips +++ b/Makefile.openwrt-mips @@ -31,11 +31,14 @@ TYPECOMMAND = cat COMPATLIBS = MAKEFILE = Makefile.openwrt-mips # PamAuth requires libpam, you may require pam-devel package to be installed +# SSLPlugin requires -lcrypto -lssl +#LIBS = -lcrypto -lssl -ldl LIBS ?= -ldl #PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin OPENSSL_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false) ifeq ($(OPENSSL_CHECK), true) + LIBS += -l crypto -l ssl PLUGINS += SSLPlugin endif PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) diff --git a/Makefile.unix b/Makefile.unix index 7b2415b..6082a79 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -36,6 +36,7 @@ MAKEFILE = Makefile.unix PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin OPENSSL_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false) ifeq ($(OPENSSL_CHECK), true) + LIBS += -l crypto -l ssl PLUGINS += SSLPlugin endif PAM_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false) diff --git a/Makefile.win b/Makefile.win index a7fa6b5..65ec8af 100644 --- a/Makefile.win +++ b/Makefile.win @@ -38,6 +38,7 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res" ifndef OPENSSL_CHECK OPENSSL_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false) ifeq ($(OPENSSL_CHECK), true) + LIBS += -l crypto -l ssl PLUGINS += SSLPlugin endif PAM_CHECK = $(shell echo "\#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false) diff --git a/src/plugins/SSLPlugin/Makefile.inc b/src/plugins/SSLPlugin/Makefile.inc index 5f2717e..1afc984 100644 --- a/src/plugins/SSLPlugin/Makefile.inc +++ b/src/plugins/SSLPlugin/Makefile.inc @@ -10,5 +10,5 @@ my_ssl$(OBJSUFFICS): my_ssl.c $(BUILDDIR)SSLPlugin$(DLSUFFICS): ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS) - $(LN) $(LNOUT)../../$(BUILDDIR)SSLPlugin$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS) $(LIBSPREFIX)crypto$(LIBSSUFFIX) $(LIBSPREFIX)ssl$(LIBSSUFFIX) + $(LN) $(LNOUT)../../$(BUILDDIR)SSLPlugin$(DLSUFFICS) $(LDFLAGS) $(DLFLAGS) ssl_plugin$(OBJSUFFICS) my_ssl$(OBJSUFFICS) $(LIBS) \ No newline at end of file From 755ff4e3784c6be53d12a4d03a147960e74c2eff Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:36:20 +0300 Subject: [PATCH 10/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 64879dc..615c39d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -50,12 +50,15 @@ jobs: - name: make clean MacOS if: ${{ startsWith(matrix.target, 'macos') }} run: make -f Makefile.FreeBSD clean + - name: install PCRE Windows + if: ${{ startsWith(matrix.target, 'windows') }} + run: vcpkg install pcre2:x64-windows - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win env: - LIBS: '-L "c:/program files/openssl/lib/VC/x64/MT"' - CFLAGS: '-I "c:/program files/openssl/include"' + LIBS: '-L "c:/program files/openssl/lib/VC/x64/MT" -L "c:/vcpkg/installed/x64-windows/lib"' + CFLAGS: '-I "c:/program files/openssl/include" -I "c:/vcpkg/installed/x64-windows/include"' - name: make clean Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win clean @@ -69,13 +72,10 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" D: cd "D:/a/3proxy/3proxy" - vcpkg install pcre2:x64-windows dir /S "c:\program files\openssl\lib\" dir "c:\vcpkg\installed\x64-windows\lib" mkdir bin64 - set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT" + set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" + set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include" nmake /F Makefile.msvc64 nmake /F Makefile.msvc64 clean - env: - LIBS: '/LIBPATH:"c:/program files/openssl/lib/VC/x64/MT"' - CFLAGS: '-I "c:/program files/openssl/include"' From 88cc6ee9d198eac0c53414c192818b171b7cf48f Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:45:09 +0300 Subject: [PATCH 11/22] fix windows makefiles for pcre --- Makefile.msvc64 | 2 +- Makefile.win | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.msvc64 b/Makefile.msvc64 index 3d2fbe1..3a2e8b2 100644 --- a/Makefile.msvc64 +++ b/Makefile.msvc64 @@ -31,7 +31,7 @@ TYPECOMMAND = type COMPATLIBS = VERFILE = 3proxy.res $(VERFILE) VERSIONDEP = 3proxy.res $(VERSIONDEP) -PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin +PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin PCREPlugin AFTERCLEAN = del src\*.res include Makefile.inc diff --git a/Makefile.win b/Makefile.win index 65ec8af..655b702 100644 --- a/Makefile.win +++ b/Makefile.win @@ -17,8 +17,8 @@ LDFLAGS ?= -O2 -s -mthreads DLFLAGS ?= -shared DLSUFFICS = .dll LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS) -LIBSPREFIX = -l -LIBSSUFFIX = +LIBSPREFIX = lib +LIBSSUFFIX = .lib LNOUT = -o EXESUFFICS = .exe OBJSUFFICS = .o @@ -45,7 +45,7 @@ PAM_CHECK = $(shell echo "\#include \\n int main(){return 0 ifeq ($(PAM_CHECK), true) PLUGINS += PamAuth endif -PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) +PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) pcre2-8.lib -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) ifeq ($(PCRE_CHECK), true) PLUGINS += PCREPlugin endif From b94c64f5e80bef3394cbe10a932c16778f5e3630 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 11:51:42 +0300 Subject: [PATCH 12/22] Update Makefile.win --- Makefile.win | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index 655b702..4d57e35 100644 --- a/Makefile.win +++ b/Makefile.win @@ -17,7 +17,7 @@ LDFLAGS ?= -O2 -s -mthreads DLFLAGS ?= -shared DLSUFFICS = .dll LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS) -LIBSPREFIX = lib +LIBSPREFIX = -l LIBSSUFFIX = .lib LNOUT = -o EXESUFFICS = .exe @@ -45,7 +45,7 @@ PAM_CHECK = $(shell echo "\#include \\n int main(){return 0 ifeq ($(PAM_CHECK), true) PLUGINS += PamAuth endif -PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) pcre2-8.lib -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) +PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -lpcre2-8.lib -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) ifeq ($(PCRE_CHECK), true) PLUGINS += PCREPlugin endif From 9a646581ee84a86ee12aac2076b24c9b063644fa Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 12:03:55 +0300 Subject: [PATCH 13/22] test github env --- .github/workflows/c-cpp.yml | 2 ++ Makefile.win | 2 +- src/plugins/PCREPlugin/pcre_plugin.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 615c39d..a9f647a 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -74,6 +74,8 @@ jobs: cd "D:/a/3proxy/3proxy" dir /S "c:\program files\openssl\lib\" dir "c:\vcpkg\installed\x64-windows\lib" + dir /S "c:\msys*" + dir /S "c:\mingw*" mkdir bin64 set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include" diff --git a/Makefile.win b/Makefile.win index 4d57e35..bc660b0 100644 --- a/Makefile.win +++ b/Makefile.win @@ -28,7 +28,7 @@ REMOVECOMMAND = rm -f TYPECOMMAND = cat COMPATLIBS = MAKEFILE = Makefile.win -PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin +PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin VERFILE := 3proxyres.o $(VERFILE) VERSION := $(VERSION) VERSIONDEP := 3proxyres.o $(VERSIONDEP) diff --git a/src/plugins/PCREPlugin/pcre_plugin.c b/src/plugins/PCREPlugin/pcre_plugin.c index 346aa77..1d09203 100644 --- a/src/plugins/PCREPlugin/pcre_plugin.c +++ b/src/plugins/PCREPlugin/pcre_plugin.c @@ -8,6 +8,7 @@ #include "../../structures.h" #include #define PCRE2_CODE_UNIT_WIDTH 8 +#define PCRE2_STATIC #include #ifdef __cplusplus From 5cfc6aaa15c60aea70f22ea96a0b6c936dd5c436 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 12:29:05 +0300 Subject: [PATCH 14/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index a9f647a..0b81265 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -74,8 +74,9 @@ jobs: cd "D:/a/3proxy/3proxy" dir /S "c:\program files\openssl\lib\" dir "c:\vcpkg\installed\x64-windows\lib" - dir /S "c:\msys*" - dir /S "c:\mingw*" + dir /S "c:\msys64\" + dir /S "c:\mingw32\" + dir /S "c:\mingw64\" mkdir bin64 set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include" From 47d6a8d03ad301ad505c889e7dc7ba10062ccc8a Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 12:38:01 +0300 Subject: [PATCH 15/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 0b81265..6286e0e 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -50,9 +50,9 @@ jobs: - name: make clean MacOS if: ${{ startsWith(matrix.target, 'macos') }} run: make -f Makefile.FreeBSD clean - - name: install PCRE Windows + - name: install Windows libraries if: ${{ startsWith(matrix.target, 'windows') }} - run: vcpkg install pcre2:x64-windows + run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S pcre2 - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win From 1580691503aa4ca6261693da3d85ff5c7670738d Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 12:40:14 +0300 Subject: [PATCH 16/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 6286e0e..98181b1 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -52,7 +52,7 @@ jobs: run: make -f Makefile.FreeBSD clean - name: install Windows libraries if: ${{ startsWith(matrix.target, 'windows') }} - run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S pcre2 + run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S pcre2 openssl - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win From 2abb889428ac9882312e5e05d48cadd1725c704f Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 12:43:47 +0300 Subject: [PATCH 17/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 98181b1..c6bed79 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -52,7 +52,7 @@ jobs: run: make -f Makefile.FreeBSD clean - name: install Windows libraries if: ${{ startsWith(matrix.target, 'windows') }} - run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S pcre2 openssl + run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm pcre2 openssl - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win From c2ba8f2b8516dee6ac595c9dafe36d130a4261a4 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 13:04:20 +0300 Subject: [PATCH 18/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index c6bed79..a9617d4 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -52,7 +52,7 @@ jobs: run: make -f Makefile.FreeBSD clean - name: install Windows libraries if: ${{ startsWith(matrix.target, 'windows') }} - run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm pcre2 openssl + run: vcpkg install pcre2:x64-windows openssl:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-openssl - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win From d3f923caba19e6847064ece14b99b0dae6346652 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 13:25:15 +0300 Subject: [PATCH 19/22] fix Makefile.win --- .github/workflows/c-cpp.yml | 11 +++-------- Makefile.win | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index a9617d4..e41380b 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -52,13 +52,13 @@ jobs: run: make -f Makefile.FreeBSD clean - name: install Windows libraries if: ${{ startsWith(matrix.target, 'windows') }} - run: vcpkg install pcre2:x64-windows openssl:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-openssl + run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-openssl - name: make Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win env: - LIBS: '-L "c:/program files/openssl/lib/VC/x64/MT" -L "c:/vcpkg/installed/x64-windows/lib"' - CFLAGS: '-I "c:/program files/openssl/include" -I "c:/vcpkg/installed/x64-windows/include"' + LIBS: '-L "c:/msys64/mingw64/lib"' + CFLAGS: '-I "c:/msys64/mingw64/include"' - name: make clean Windows if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win clean @@ -72,11 +72,6 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" D: cd "D:/a/3proxy/3proxy" - dir /S "c:\program files\openssl\lib\" - dir "c:\vcpkg\installed\x64-windows\lib" - dir /S "c:\msys64\" - dir /S "c:\mingw32\" - dir /S "c:\mingw64\" mkdir bin64 set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib" set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include" diff --git a/Makefile.win b/Makefile.win index bc660b0..d9ce2ec 100644 --- a/Makefile.win +++ b/Makefile.win @@ -18,7 +18,7 @@ DLFLAGS ?= -shared DLSUFFICS = .dll LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS) LIBSPREFIX = -l -LIBSSUFFIX = .lib +LIBSSUFFIX = LNOUT = -o EXESUFFICS = .exe OBJSUFFICS = .o From 4df7a09a2aa40cac540dfbfbf2cb45429186c992 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 13:26:35 +0300 Subject: [PATCH 20/22] Update Makefile.win --- Makefile.win | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.win b/Makefile.win index d9ce2ec..b4b69b9 100644 --- a/Makefile.win +++ b/Makefile.win @@ -28,7 +28,7 @@ REMOVECOMMAND = rm -f TYPECOMMAND = cat COMPATLIBS = MAKEFILE = Makefile.win -PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin +PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin VERFILE := 3proxyres.o $(VERFILE) VERSION := $(VERSION) VERSIONDEP := 3proxyres.o $(VERSIONDEP) @@ -45,7 +45,7 @@ PAM_CHECK = $(shell echo "\#include \\n int main(){return 0 ifeq ($(PAM_CHECK), true) PLUGINS += PamAuth endif -PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -lpcre2-8.lib -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) +PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include \\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -lpcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false) ifeq ($(PCRE_CHECK), true) PLUGINS += PCREPlugin endif From aa4521b1f624988fef4971372043f427de1662b0 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 13:37:21 +0300 Subject: [PATCH 21/22] Use external LDFLAGS --- Makefile.Linux | 2 +- Makefile.win | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.Linux b/Makefile.Linux index 732c0f2..95866db 100644 --- a/Makefile.Linux +++ b/Makefile.Linux @@ -14,7 +14,7 @@ CFLAGS := -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOU COUT = -o LN ?= ${CC} DCFLAGS ?= -LDFLAGS ?= -fPIC -O2 -fno-strict-aliasing -pthread +LDFLAGS := -fPIC -O2 -fno-strict-aliasing -pthread $(LDFLAGS) DLFLAGS ?= -shared DLSUFFICS = .ld.so # -lpthreads may be reuqired on some platforms instead of -pthreads diff --git a/Makefile.win b/Makefile.win index b4b69b9..2980f8c 100644 --- a/Makefile.win +++ b/Makefile.win @@ -13,7 +13,7 @@ CC ?= gcc CFLAGS := -O2 -s -c -mthreads -DWITH_STD_MALLOC -DWITH_WSAPOLL $(CFLAGS) COUT = -o LN ?= $(CC) -LDFLAGS ?= -O2 -s -mthreads +LDFLAGS := -O2 -s -mthreads $(LDFLAGS) DLFLAGS ?= -shared DLSUFFICS = .dll LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS) From 6dad1aff596cff3eea58bcb42bfd9d518250d346 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Fri, 3 Apr 2026 13:49:41 +0300 Subject: [PATCH 22/22] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e41380b..840603c 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -57,7 +57,7 @@ jobs: if: ${{ startsWith(matrix.target, 'windows') }} run: make -f Makefile.win env: - LIBS: '-L "c:/msys64/mingw64/lib"' + LDFLAGS: '-L "c:/msys64/mingw64/lib"' CFLAGS: '-I "c:/msys64/mingw64/include"' - name: make clean Windows if: ${{ startsWith(matrix.target, 'windows') }}