Compare commits

...

3 Commits

Author SHA1 Message Date
jendis
8195e398bf
Merge 983df6f7ae into 9acb538721 2026-04-09 09:51:40 -04:00
Vladimir Dubrovin
9acb538721 Update workflow and builds
Some checks failed
RPM/DEB build aarch64 / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
RPM/DEB build armhf / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
RPM/DEB build x86-64 / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
2026-04-09 16:48:13 +03:00
Jan Smutny
983df6f7ae Extend SOCKS for AnyIP utilization
Introduce '-k' parameter that overwrites the -e parameter (if given) and
uses the IP for the external connection that corresponds to the current client
connection. The benefit arises when the parameter '-i0.0.0.0' or '-i::' in case
of IPv6 is set. This allows the entire range configured as local on the system
to receive connections and establish connections to the target server using the
IP address to which the client connected.
Note: This feature is not applicable for Windows.
2025-02-06 13:23:03 +01:00
24 changed files with 193 additions and 164 deletions

View File

@ -1,8 +1,8 @@
name: RPM build arm
name: RPM/DEB build aarch64
on:
push:
branches: [ "master" ]
branches: [ "master", "test-ci" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-arm64.yml' ]
jobs:
@ -11,10 +11,10 @@ jobs:
strategy:
matrix:
target:
- ubuntu-latest
- ubuntu-24.04-arm
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: env
run: |
pwd
@ -23,49 +23,49 @@ jobs:
echo "MAJOR=$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV
echo "SUBMAJOR=$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV
echo "MINOR=$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV
- name: echo env
run: echo "release $RELEASE version $VERSION major $MAJOR submajor $SUBMAJOR minor $MINOR"
- name: Linux libraries
run: |
sudo apt update
sudo dpkg --add-architecture arm64
echo "Types: deb" > ~/ubuntu.sources
echo "URIs: http://archive.ubuntu.com/ubuntu/" >> ~/ubuntu.sources
echo "Suites: noble noble-updates noble-backports" >> ~/ubuntu.sources
echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources
echo "Architectures: amd64" >> ~/ubuntu.sources
echo "" >> ~/ubuntu.sources
echo "Types: deb" >> ~/ubuntu.sources
echo "URIs: http://security.ubuntu.com/ubuntu/" >> ~/ubuntu.sources
echo "Suites: noble-security" >> ~/ubuntu.sources
echo "Components: main restricted universe multiverse" >> ~/ubuntu.sources
echo "Architectures: amd64" >> ~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >> ~/ubuntu.sources
echo "" >> ~/ubuntu.sources
echo "Types: deb" >>~/ubuntu.sources
echo "URIs: http://ports.ubuntu.com/ubuntu-ports/" >>~/ubuntu.sources
echo "Suites: noble noble-updates" >>~/ubuntu.sources
echo "Components: main restricted universe multiverse" >>~/ubuntu.sources
echo "Architectures: arm64" >>~/ubuntu.sources
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/ubuntu.sources
sudo cp ~/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt install libssl-dev:arm64 libpam0g:arm64 libpam0g-dev:arm64 libpcre2-dev:arm64 rpm crossbuild-essential-arm64
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
- name: configure rpm env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
cd ~/rpmbuild/SPECS
rpmbuild -ba --define "PAMLIB pam0g" --define "_arch aarch64" --define "cross yes" --target=aarch64-linux-gnueabi 3proxy-$RELEASE.spec
rpmbuild -ba 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm 3proxy-$RELEASE.arm64.rpm
- name: Get artifact
- name: Get artifact arp
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm64.rpm"
path: "*.rpm"
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
- name: Get artifact deb
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm64.deb"
path: "*.deb"

View File

@ -1,8 +1,8 @@
name: RPM build arm
name: RPM/DEB build armhf
on:
push:
branches: [ "master" ]
branches: [ "master", "test-ci" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-armhf.yml' ]
jobs:
@ -14,7 +14,7 @@ jobs:
- ubuntu-latest
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: env
run: |
pwd
@ -49,18 +49,25 @@ jobs:
echo "Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" >>~/ubuntu.sources
sudo cp ~/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
sudo apt install libssl-dev:armhf libpam0g:armhf libpam0g-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-armhf
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
sudo apt install libssl3t64:armhf openssl:armhf libssl-dev:armhf libpam0g:armhf libpam0g-dev:armhf libpcre2-dev:armhf rpm crossbuild-essential-armhf build-essential debhelper
- name: configure rpm env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
cd ~/rpmbuild/SPECS
PATH=/usr/arm-linux-gnueabihf/bin:$PATH
export PATH=$PATH
CC=arm-linux-gnueabihf-gcc
export CC=$CC
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
rpmbuild -ba --define "PAMLIB pam0g" --define "_arch arm" --define "cross yes" --target=arm-linux-gnueabi 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.arm.rpm
@ -69,4 +76,29 @@ jobs:
with:
name: "3proxy-${{ env.RELEASE }}-arm.rpm"
path: "*.rpm"
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
PATH=/usr/arm-linux-gnueabihf/bin:$PATH
export PATH=$PATH
CC=arm-linux-gnueabihf-gcc
export CC=$CC
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
- name: Get artifact deb
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-arm.deb"
path: "*.deb"

View File

@ -1,8 +1,8 @@
name: RPM build x86-64
name: RPM/DEB build x86-64
on:
push:
branches: [ "master" ]
branches: [ "master", "test-ci" ]
paths: [ 'RELEASE', '.github/workflows/build-rpm-x86-64.yml' ]
jobs:
@ -14,7 +14,7 @@ jobs:
- ubuntu-latest
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: env
run: |
pwd
@ -28,14 +28,15 @@ jobs:
- name: Linux libraries
run: |
sudo apt update
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm
- name: make rpmbuild dir
run: mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
- name: configure rpm env
sudo apt install libssl-dev libpam-dev libpcre2-dev rpm build-essential debhelper
- name: configure rpm/deb env
run: |
mkdir ~/debian
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czf ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz --transform "s,^,3proxy-$RELEASE/," .
ln -s ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/rpmbuild/SOURCES/$RELEASE.tar.gz
cp scripts/rh/3proxy.spec ~/rpmbuild/SPECS/3proxy-$RELEASE.spec
cp ~/rpmbuild/SOURCES/3proxy-$RELEASE.tar.gz ~/debian/3proxy_$RELEASE.orig.tar.gz
- name: rpmbuild
run: |
ret=`pwd`
@ -43,9 +44,29 @@ jobs:
rpmbuild -ba 3proxy-$RELEASE.spec
cd $ret
mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm 3proxy-$RELEASE.x86_64.rpm
- name: Get artifact
- name: Get artifact rpm
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-x86_64.rpm"
path: "*.rpm"
- name: debbuild
run: |
ret=`pwd`
cd ~/debian/
tar xzf 3proxy_$RELEASE.orig.tar.gz
cd 3proxy-$RELEASE
echo "3proxy ($RELEASE-$VERSION) buster; urgency=medium" >debian/changelog
echo " " >>debian/changelog
echo " *3proxy $RELEASE build" >>debian/changelog
echo " " >>debian/changelog
echo " -- z3APA3A <3apa3a@3proxy.org> "`date "+%a, %d %b %Y %H:%M:%S %z"` >>debian/changelog
echo "">>debian/changelog
dpkg-buildpackage
cd $ret
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
- name: Get artifact deb
uses: actions/upload-artifact@v4
with:
name: "3proxy-${{ env.RELEASE }}-x86_64.deb"
path: "*.deb"

View File

@ -14,7 +14,7 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: Setup Open Watcom
@ -25,14 +25,13 @@ jobs:
echo "now: $NOW"
$RELEASE = Get-Content -Path "RELEASE" -Raw
echo "release: $RELEASE"
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=VERSION=`"$RELEASE`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=BUILDDATE=`"$NOW`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: make Watcom
shell: cmd
run: |
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
nmake /F Makefile.watcom
- name: make dist dir
shell: cmd

View File

@ -14,19 +14,16 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: set date
run: |
$NOW = Get-Date -Format "yyMMddHHmmss"
echo "now: $NOW"
$RELEASE = Get-Content -Path "RELEASE" -Raw
echo "release: $RELEASE"
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=VERSION=`"$RELEASE`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=BUILDDATE=`"$NOW`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: install packages
run: vcpkg install pcre2:x86-windows-static openssl:x86-windows-static
- name: Add msbuild to PATH
@ -40,7 +37,7 @@ jobs:
cd "D:/a/3proxy/3proxy"
set "LIB=%LIB%;c:/vcpkg/installed/x86-windows-static/lib"
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x86-windows-static/include"
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
nmake /F Makefile.msvc
- name: make dist dir
shell: cmd

View File

@ -14,19 +14,17 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: set date
run: |
$NOW = Get-Date -Format "yyMMddHHmmss"
echo "now: $NOW"
$RELEASE = Get-Content -Path "RELEASE" -Raw
echo "release: $RELEASE"
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=VERSION=`"$RELEASE`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=BUILDDATE=`"$NOW`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: install packages
run: vcpkg install pcre2:x64-windows-static openssl:x64-windows-static
- name: Add msbuild to PATH
@ -40,7 +38,8 @@ jobs:
cd "D:/a/3proxy/3proxy"
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib"
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include"
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
nmake /F Makefile.msvc
- name: make dist dir
shell: cmd

View File

@ -14,19 +14,16 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: set date
run: |
$NOW = Get-Date -Format "yyMMddHHmmss"
echo "now: $NOW"
$RELEASE = Get-Content -Path "RELEASE" -Raw
echo "release: $RELEASE"
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=VERSION=`"$RELEASE`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=BUILDDATE=`"$NOW`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: install packages
run: vcpkg install pcre2:arm64-windows-static openssl:arm64-windows-static
- name: Add msbuild to PATH
@ -40,7 +37,7 @@ jobs:
cd "D:/a/3proxy/3proxy"
set "LIB=%LIB%;c:/vcpkg/installed/arm64-windows-static/lib"
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/arm64-windows-static/include"
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
echo "volatile char VerSion[]=^"3APA3A-3proxy-Internal-Build: 3proxy-%RELEASE%-%NOW%\r\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
nmake /F Makefile.msvc
- name: make dist dir
shell: cmd

View File

@ -18,7 +18,7 @@ jobs:
- ubuntu-24.04-arm
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: Linux libraries

View File

@ -17,7 +17,7 @@ jobs:
- macos-15
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: Mac libraries

View File

@ -17,7 +17,7 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: install Windows libraries
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

View File

@ -20,7 +20,7 @@ jobs:
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
# - name: configure
# run: ./configure
- name: Linux libraries

View File

@ -485,19 +485,15 @@ install(TARGETS 3proxy mycrypt proxy socks pop3p smtpp ftppr tcppm udppm tlspr
)
# Install plugins
file(GLOB PLUGINFILES "${PLUGIN_OUTPUT_DIR}/*${PLUGIN_SUFFIX}")
if(WIN32)
install(FILES
${PLUGIN_OUTPUT_DIR}/utf8tocp1251${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/WindowsAuthentication${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
${PLUGINFILES}
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
else()
install(FILES
${PLUGIN_OUTPUT_DIR}/StringsPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TrafficPlugin${PLUGIN_SUFFIX}
${PLUGIN_OUTPUT_DIR}/TransparentPlugin${PLUGIN_SUFFIX}
${PLUGINFILES}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
)
endif()

View File

@ -6,13 +6,9 @@
BUILDDIR = ../bin/
CC = cl
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "WITH_SSL" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "PRIx64=\"I64x\"" /Fp"proxy.pch" /FD /c
!IFDEF RELEASE
VERSION=/D VERSION=\"3proxy-$(RELEASE)\"
!ENDIF
!IFDEF NOW
BUILDDATE=/D BUILDDATE=\"$(NOW)\"
!ENDIF
VERSION = $(VERSION)
BUILDDATE = $(BUILDDATE)
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "WITH_SSL" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c $(BUILDDATE) $(VERSION)
COUT = /Fo
LN = link
LDFLAGS = /nologo /subsystem:console /incremental:no
@ -33,9 +29,7 @@ COMPATLIBS =
MAKEFILE = Makefile.msvc
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin PCREPlugin
VERFILE = 3proxy.res $(VERFILE)
VERSION = $(VERSION)
VERSIONDEP = 3proxy.res $(VERSIONDEP)
BUILDDATE = $(BUILDDATE)
AFTERCLEAN = if exist src\*.res (del src\*.res) && if exist src\*.err (del src\*.err)
include Makefile.inc

View File

@ -6,7 +6,7 @@
BUILDDIR = ../bin/
CC = cl
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE)
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE)
COUT = /Fo
LN = link
LDFLAGS = /nologo /subsystem:console /incremental:no
@ -62,9 +62,3 @@ allplugins:
nmake
del *.obj *.idb
cd ../../
copy Makefile plugins\PCREPlugin
copy Makefile.var plugins\PCREPlugin
cd plugins\PCREPlugin
nmake
del *.obj *.idb
cd ../../

View File

@ -4,30 +4,6 @@
# This file defines functions for building plugins
#
# Function to add a simple plugin (single source file, no dependencies)
function(add_3proxy_plugin_simple PLUGIN_NAME SOURCE_FILE)
if(WIN32)
set(PLUGIN_SUFFIX ".dll")
else()
set(PLUGIN_SUFFIX ".ld.so")
endif()
add_library(${PLUGIN_NAME} SHARED ${SOURCE_FILE})
set_target_properties(${PLUGIN_NAME} PROPERTIES
PREFIX ""
SUFFIX ${PLUGIN_SUFFIX}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(${PLUGIN_NAME} PRIVATE Threads::Threads)
target_include_directories(${PLUGIN_NAME} PRIVATE
${CMAKE_SOURCE_DIR}/src
)
endfunction()
# Function to add a plugin with dependencies
function(add_3proxy_plugin PLUGIN_NAME)
set(options "")

4
debian/conffiles vendored
View File

@ -1,4 +0,0 @@
/usr/local/3proxy/conf/3proxy.cfg
/usr/local/3proxy/conf/add3proxyuser.sh
/usr/local/3proxy/conf/bandlimiters
/usr/local/3proxy/conf/counters

14
debian/postinst vendored
View File

@ -1,10 +1,3 @@
if [ ! -f /usr/local/3proxy/conf/passwd ]; then \
touch /usr/local/3proxy/conf/passwd;\
fi
chown -R proxy:proxy /usr/local/3proxy
chmod 550 /usr/local/3proxy/
chmod 550 /usr/local/3proxy/conf/
chmod 440 /usr/local/3proxy/conf/*
if /bin/systemctl >/dev/null 2>&1; then \
/usr/sbin/update-rc.d 3proxy disable || true; \
/usr/sbin/chkconfig 3proxy off || true; \
@ -34,10 +27,3 @@ elif [ -x /usr/sbin/service ]; then \
echo " "service 3proxy stop ;\
echo to stop proxy ;\
fi
echo " "/usr/local/3proxy/conf/add3proxyuser.sh
echo to add users
echo ""
echo Default config uses Google\'s DNS.
echo It\'s recommended to use provider supplied DNS or install local recursor, e.g. pdns-recursor.
echo Configure preferred DNS in /usr/local/3proxy/conf/3proxy.cfg.
echo run \'/usr/local/3proxy/conf/add3proxyuser.sh admin password\' to configure \'admin\' user

6
debian/rules vendored
View File

@ -3,14 +3,8 @@
%:
dh $@
override_dh_auto_build:
ln -s Makefile.Linux Makefile || true
dh_auto_build
override_dh_auto_clean:
find src/ -type f -name "*.o" -delete
find src/ -type f -name "Makefile.var" -delete
find bin/ -type f -executable -delete
rm -f Makefile
override_dh_usrlocal:

View File

@ -67,14 +67,10 @@
<ul>
<li><A NAME="MSVC">How to compile 3proxy with Visual C++</A>
<p>
Extract source code files from 3proxy.tgz (with WinZip or another utility).
For 64-bit Windows use:
Extract source code files from 3proxy.tgz (with WinZip or another utility) or use git.
<pre>
nmake /f Makefile.msvc64
</pre>
For ARM64 Windows use:
<pre>
nmake /f Makefile.msvcARM64
nmake /f Makefile.msvc
</pre>
Binaries will be placed in the <code>bin/</code> directory.
</p>

View File

@ -73,13 +73,10 @@
<ul>
<li><a name="MSVC"><i>Как скомпилировать 3proxy Visual C++</i></a>
<p>
Извлеките файлы из архива 3proxy.tgz (например, с помощью WinZip).
Для 64-битной Windows используйте:
Извлеките файлы из архива 3proxy.tgz (например, с помощью WinZip) или используйте git.
<pre>
nmake /f Makefile.msvc64</pre>
Для Windows ARM64 используйте:
<pre>
nmake /f Makefile.msvcARM64</pre>
nmake /f Makefile.msvc
</pre>
Исполняемые файлы будут помещены в каталог <code>bin/</code>.
</p>
<li><a name="CMAKE"><i>Как скомпилировать 3proxy с помощью CMake</i></a>

View File

@ -42,6 +42,16 @@ of IP-IP NAT (will not work for PAT).
Internal address. IP address the proxy accepts connections to.
By default, connections to any interface are accepted. It\'s usually unsafe.
.TP
.B -k
External address given by
.B -e
is ignored and the internal address or generally the address client conected to is used instead.
This allows to utilize AnyIP Linux feature when
.B -i0.0.0.0
or in case of IPv6
.B -i::
is set. Not available for Windows platform.
.TP
.B -p
Port. Port proxy listens for incoming connections. Default is 1080.
.TP

View File

@ -563,16 +563,48 @@ int doconnect(struct clientparam * param){
if(!*SAPORT(&param->sinsr))*SAPORT(&param->sinsr) = *SAPORT(&param->req);
if ((param->remsock=param->srv->so._socket(param->sostate, SASOCK(&param->sinsr), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {return (11);}
if(SAISNULL(&param->sinsl)){
if (param->srv->keepip) {
#ifndef NOIPV6
if(*SAFAMILY(&param->sinsr) == AF_INET6) param->sinsl = param->srv->extsa6;
else
struct sockaddr_in6 local_addr;
socklen_t local_addr_len = sizeof(local_addr);
getsockname(param->clisock, (struct sockaddr *)&local_addr, &local_addr_len);
if(*SAFAMILY(&local_addr) == AF_INET6) {
if (IN6_IS_ADDR_V4MAPPED(&local_addr.sin6_addr)) {
struct sockaddr_in6 local_addr2;
memset(&local_addr2, 0, sizeof(local_addr2));
local_addr2.sin6_family = AF_INET;
local_addr2.sin6_port = local_addr.sin6_port;
param->sinsl = local_addr2;
} else {
param->sinsl = local_addr;
}
} else {
param->sinsl = local_addr;
}
#else
struct sockaddr_in local_addr;
socklen_t local_addr_len = sizeof(local_addr);
getsockname(new_sock, (struct sockaddr *)&local_addr, &local_addr_len);
param->sinsl = local_addr;
#endif
param->sinsl = param->srv->extsa;
} else {
#ifndef NOIPV6
if(*SAFAMILY(&param->sinsr) == AF_INET6) param->sinsl = param->srv->extsa6;
else
#endif
param->sinsl = param->srv->extsa;
}
}
*SAPORT(&param->sinsl) = 0;
setopts(param->remsock, param->srv->srvsockopts);
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
if (param->srv->keepip) {
int opt = 1;
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_IP, IP_FREEBIND, (char *)&opt, sizeof(int));
}
#ifdef REUSE
{
int opt;

View File

@ -288,6 +288,9 @@ int MODULEMAINFUNC (int argc, char** argv){
"\n"
" -iIP ip address or internal interface (clients are expected to connect)\n"
" -eIP ip address or external interface (outgoing connection will have this)\n"
#ifndef _WIN32
" -k outgoing connection will have local IP where client connected, thus ignores -e (useful in AnyIP case)\n"
#endif
" -rHOST:PORT Use IP:port for connect back proxy instead of listen port\n"
" -RHOST:PORT Use PORT to listen connect back proxy connection to pass data to\n"
" -4 Use IPv4 for outgoing connections\n"
@ -426,6 +429,13 @@ int MODULEMAINFUNC (int argc, char** argv){
#endif
}
break;
#ifndef _WIN32
case 'k':
{
srv.keepip = 1;
}
break;
#endif
case 'N':
getip46(46, (unsigned char *)argv[i]+2, (struct sockaddr *)&srv.extNat);
break;
@ -815,6 +825,7 @@ int MODULEMAINFUNC (int argc, char** argv){
}
else {
new_sock = srv.so._accept(srv.so.state, sock, (struct sockaddr*)&defparam.sincr, &size);
if(new_sock == INVALID_SOCKET){
#ifdef _WIN32
switch(WSAGetLastError()){
@ -990,6 +1001,7 @@ void srvinit(struct srvparam * srv, struct clientparam *param){
srv->logdumpcli = conf.logdumpcli;
srv->cbsock = INVALID_SOCKET;
srv->needuser = 1;
srv->keepip = 0;
#ifdef WITHSPLICE
srv->usesplice = 1;
#endif

View File

@ -493,6 +493,7 @@ struct srvparam {
int paused, version;
int singlepacket;
int usentlm;
int keepip;
int needuser;
int silent;
int transparent;