mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
No files matched your search
@@ -0,0 +1,140 @@
|
|||||||
|
name: OpenWrt ipk build
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
env:
|
||||||
|
OPENWRT_RELEASE: 24.10.0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ipk:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "${{ matrix.arch }}"
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- target: ramips/mt7621
|
||||||
|
arch: mipsel_24kc
|
||||||
|
- target: ath79/generic
|
||||||
|
arch: mips_24kc
|
||||||
|
- target: ipq40xx/generic
|
||||||
|
arch: arm_cortex-a7_neon-vfpv4
|
||||||
|
- target: mediatek/filogic
|
||||||
|
arch: aarch64_cortex-a53
|
||||||
|
# 26.04: the OpenWrt SDK refuses its non-GNU install
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: env
|
||||||
|
run: echo "RELEASE=$(tr -d ' \t\r\n' < RELEASE)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y build-essential libncurses-dev zlib1g-dev gawk git \
|
||||||
|
gettext libssl-dev xsltproc wget unzip python3 rsync file zstd
|
||||||
|
|
||||||
|
- name: Fetch SDK
|
||||||
|
run: |
|
||||||
|
BASE="https://downloads.openwrt.org/releases/$OPENWRT_RELEASE/targets/${{ matrix.target }}"
|
||||||
|
# The SDK file name carries the toolchain flavour, which differs between
|
||||||
|
# targets (musl vs musl_eabi), so take it from the directory listing.
|
||||||
|
NAME=$(curl -fsSL "$BASE/" | grep -oE 'openwrt-sdk-[^"]*\.tar\.zst' | head -1)
|
||||||
|
if [ -z "$NAME" ]; then echo "no SDK for ${{ matrix.target }}"; exit 1; fi
|
||||||
|
echo "fetching $NAME"
|
||||||
|
curl -fsSL "$BASE/$NAME" -o sdk.tar.zst
|
||||||
|
tar --zstd -xf sdk.tar.zst
|
||||||
|
mv "${NAME%.tar.zst}" sdk
|
||||||
|
rm sdk.tar.zst
|
||||||
|
|
||||||
|
- name: Stage the package
|
||||||
|
run: |
|
||||||
|
mkdir -p sdk/package/3proxy sdk/dl
|
||||||
|
cp -a scripts/openwrt/. sdk/package/3proxy/
|
||||||
|
# Build the checkout rather than a published tarball, so the workflow
|
||||||
|
# does not depend on the release archive existing yet.
|
||||||
|
git archive --format=tar.gz --prefix="3proxy-$RELEASE/" -o "sdk/dl/3proxy-$RELEASE.tar.gz" HEAD
|
||||||
|
HASH=$(sha256sum "sdk/dl/3proxy-$RELEASE.tar.gz" | cut -d' ' -f1)
|
||||||
|
sed -i "s|^PKG_VERSION:=.*|PKG_VERSION:=$RELEASE|" sdk/package/3proxy/Makefile
|
||||||
|
sed -i "s|^PKG_HASH:=.*|PKG_HASH:=$HASH|" sdk/package/3proxy/Makefile
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd sdk
|
||||||
|
./scripts/feeds update base packages
|
||||||
|
./scripts/feeds install libopenssl libpcre2
|
||||||
|
echo CONFIG_PACKAGE_3proxy=m >> .config
|
||||||
|
make defconfig
|
||||||
|
make package/3proxy/compile -j$(nproc)
|
||||||
|
|
||||||
|
- name: Collect
|
||||||
|
run: |
|
||||||
|
find sdk/bin -name '3proxy_*.ipk' -exec cp {} . \;
|
||||||
|
ls -l *.ipk
|
||||||
|
for f in *.ipk; do echo "$f"; done
|
||||||
|
|
||||||
|
- name: Get artifact ipk
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-${{ matrix.arch }}.ipk"
|
||||||
|
path: "*.ipk"
|
||||||
|
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\ndefault-cache-ttl 7200\nmax-cache-ttl 7200\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
echo prime > /tmp/prime.txt
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$KEYID" --detach-sign -o /dev/null /tmp/prime.txt
|
||||||
|
rm -f /tmp/prime.txt
|
||||||
|
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
# opkg verifies the signature of a feed index, never of a package file,
|
||||||
|
# so the checksums and their signature are what a manual install can be
|
||||||
|
# checked against.
|
||||||
|
sha256sum *.ipk > SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
for f in *.ipk SHA256SUMS-openwrt-${{ matrix.arch }}; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
gpg --verify SHA256SUMS-openwrt-${{ matrix.arch }}.asc SHA256SUMS-openwrt-${{ matrix.arch }}
|
||||||
|
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v2
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.ipk
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: |
|
||||||
|
gh release upload "$TAG" *.ipk *.ipk.asc \
|
||||||
|
SHA256SUMS-openwrt-${{ matrix.arch }} SHA256SUMS-openwrt-${{ matrix.arch }}.asc
|
||||||
@@ -18,7 +18,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
- ubuntu-latest
|
# 26.04: rpm 6 runs %__gpg_sign_cmd differently, signing fails
|
||||||
|
- ubuntu-24.04
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
|
|||||||
@@ -38,19 +38,8 @@ jobs:
|
|||||||
- name: make Watcom
|
- name: make Watcom
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
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\n^";" >>src/3proxy.c
|
||||||
nmake /F Makefile.watcom
|
nmake /F Makefile.watcom
|
||||||
- name: Decode Certificate
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.WINDOWS_CERTIFICATE }}")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\cert.pfx", $pfx_cert_byte)
|
|
||||||
- name: Sign
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$signtool = (Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1).FullName
|
|
||||||
& $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "bin\3proxy.exe"
|
|
||||||
& $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}" /tr http://timestamp.digicert.com /td sha256 /fd sha256 "bin\3proxy_crypt.exe"
|
|
||||||
- name: make dist dir
|
- name: make dist dir
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -44,27 +44,8 @@ jobs:
|
|||||||
cd "D:/a/3proxy/3proxy"
|
cd "D:/a/3proxy/3proxy"
|
||||||
set "LIB=%LIB%;c:/vcpkg/installed/x86-windows-static/lib"
|
set "LIB=%LIB%;c:/vcpkg/installed/x86-windows-static/lib"
|
||||||
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x86-windows-static/include"
|
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\n^";" >>src/3proxy.c
|
||||||
nmake /F Makefile.msvc WOLFSSL=1
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
- name: Decode Certificate
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.WINDOWS_CERTIFICATE }}")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\cert.pfx", $pfx_cert_byte)
|
|
||||||
- name: Extract public certificate
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("${{ github.workspace }}\cert.pfx", "$env:CERT_PASSWORD")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\3proxy.crt", $cert.Export("Cert"))
|
|
||||||
- name: Sign
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$signtool = (Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1).FullName
|
|
||||||
Get-ChildItem bin\*.exe, bin\*.dll | ForEach-Object { & $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "$env:CERT_PASSWORD" /tr http://timestamp.digicert.com /td sha256 /fd sha256 $_.FullName }
|
|
||||||
- name: make dist dir
|
- name: make dist dir
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@@ -95,7 +76,6 @@ jobs:
|
|||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README.md dist\3proxy\
|
copy README.md dist\3proxy\
|
||||||
copy rus.3ps dist\3proxy\
|
copy rus.3ps dist\3proxy\
|
||||||
copy 3proxy.crt dist\3proxy\
|
|
||||||
- name: Get artifact
|
- name: Get artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -44,28 +44,9 @@ jobs:
|
|||||||
cd "D:/a/3proxy/3proxy"
|
cd "D:/a/3proxy/3proxy"
|
||||||
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib"
|
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib"
|
||||||
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include"
|
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\n^";" >>src/3proxy.c
|
||||||
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
||||||
nmake /F Makefile.msvc WOLFSSL=1
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
- name: Decode Certificate
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.WINDOWS_CERTIFICATE }}")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\cert.pfx", $pfx_cert_byte)
|
|
||||||
- name: Extract public certificate
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("${{ github.workspace }}\cert.pfx", "$env:CERT_PASSWORD")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\3proxy.crt", $cert.Export("Cert"))
|
|
||||||
- name: Sign
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$signtool = (Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1).FullName
|
|
||||||
Get-ChildItem bin\*.exe, bin\*.dll | ForEach-Object { & $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "$env:CERT_PASSWORD" /tr http://timestamp.digicert.com /td sha256 /fd sha256 $_.FullName }
|
|
||||||
- name: make dist dir
|
- name: make dist dir
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@@ -96,7 +77,6 @@ jobs:
|
|||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README.md dist\3proxy\
|
copy README.md dist\3proxy\
|
||||||
copy rus.3ps dist\3proxy\
|
copy rus.3ps dist\3proxy\
|
||||||
copy 3proxy.crt dist\3proxy\
|
|
||||||
- name: Get artifact
|
- name: Get artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -44,27 +44,8 @@ jobs:
|
|||||||
cd "D:/a/3proxy/3proxy"
|
cd "D:/a/3proxy/3proxy"
|
||||||
set "LIB=%LIB%;c:/vcpkg/installed/arm64-windows-static/lib"
|
set "LIB=%LIB%;c:/vcpkg/installed/arm64-windows-static/lib"
|
||||||
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/arm64-windows-static/include"
|
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\n^";" >>src/3proxy.c
|
||||||
nmake /F Makefile.msvc WOLFSSL=1
|
nmake /F Makefile.msvc WOLFSSL=1
|
||||||
- name: Decode Certificate
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.WINDOWS_CERTIFICATE }}")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\cert.pfx", $pfx_cert_byte)
|
|
||||||
- name: Extract public certificate
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("${{ github.workspace }}\cert.pfx", "$env:CERT_PASSWORD")
|
|
||||||
[System.IO.File]::WriteAllBytes("${{ github.workspace }}\3proxy.crt", $cert.Export("Cert"))
|
|
||||||
- name: Sign
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
|
||||||
CERT_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
$signtool = (Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object { [version]$_.Directory.Parent.Name } -Descending | Select-Object -First 1).FullName
|
|
||||||
Get-ChildItem bin\*.exe, bin\*.dll | ForEach-Object { & $signtool sign /f "${{ github.workspace }}\cert.pfx" /p "$env:CERT_PASSWORD" /tr http://timestamp.digicert.com /td sha256 /fd sha256 $_.FullName }
|
|
||||||
- name: make dist dir
|
- name: make dist dir
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@@ -95,7 +76,6 @@ jobs:
|
|||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README.md dist\3proxy\
|
copy README.md dist\3proxy\
|
||||||
copy rus.3ps dist\3proxy\
|
copy rus.3ps dist\3proxy\
|
||||||
copy 3proxy.crt dist\3proxy\
|
|
||||||
- name: Get artifact
|
- name: Get artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -94,13 +94,13 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- image: full
|
- image: full
|
||||||
suffix: ''
|
suffix: ''
|
||||||
floating: latest
|
floating: lts
|
||||||
- image: busybox
|
- image: busybox
|
||||||
suffix: .busybox
|
suffix: .busybox
|
||||||
floating: busybox
|
floating: lts-busybox
|
||||||
- image: minimal
|
- image: minimal
|
||||||
suffix: .minimal
|
suffix: .minimal
|
||||||
floating: minimal
|
floating: lts-minimal
|
||||||
steps:
|
steps:
|
||||||
- name: Download digests
|
- name: Download digests
|
||||||
uses: actions/download-artifact@v7
|
uses: actions/download-artifact@v7
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
name: Release source tarball
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tarball:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
name: "source tarball"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: env
|
||||||
|
run: |
|
||||||
|
if [ -f RELEASE ]; then
|
||||||
|
RELEASE=$(tr -d ' \t\r\n' < RELEASE)
|
||||||
|
else
|
||||||
|
RELEASE=$(tr -d ' \t\r\n' < DEVEL)
|
||||||
|
fi
|
||||||
|
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
run: |
|
||||||
|
# git archive is reproducible from the tag: anyone can regenerate the
|
||||||
|
# tarball and compare it against the published checksum.
|
||||||
|
git archive --format=tar.gz -9 \
|
||||||
|
--prefix="3proxy-${{ env.RELEASE }}/" \
|
||||||
|
-o "3proxy-${{ env.RELEASE }}.tar.gz" HEAD
|
||||||
|
tar tzf "3proxy-${{ env.RELEASE }}.tar.gz" >/dev/null
|
||||||
|
ls -l *.tar.gz
|
||||||
|
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-src"
|
||||||
|
path: "*.tar.gz"
|
||||||
|
|
||||||
|
- name: Import signing key
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
if [ -z "$GPG_PRIVATE_KEY" ]; then echo "GPG_PRIVATE_KEY is not set"; exit 1; fi
|
||||||
|
mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
|
||||||
|
printf 'allow-loopback-pinentry\n' > ~/.gnupg/gpg-agent.conf
|
||||||
|
gpgconf --kill gpg-agent || true
|
||||||
|
printf '%s' "$GPG_PRIVATE_KEY" | gpg --batch --import
|
||||||
|
KEYID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/{print $5; exit}')
|
||||||
|
echo "GPG_KEYID=$KEYID" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checksums and detached signatures
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||||
|
run: |
|
||||||
|
sha256sum *.tar.gz > SHA256SUMS-src
|
||||||
|
for f in *.tar.gz SHA256SUMS-src; do
|
||||||
|
gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" \
|
||||||
|
-u "$GPG_KEYID" --armor --detach-sign "$f"
|
||||||
|
done
|
||||||
|
sha256sum -c SHA256SUMS-src
|
||||||
|
gpg --verify SHA256SUMS-src.asc SHA256SUMS-src
|
||||||
|
|
||||||
|
- name: Attest build provenance
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
uses: actions/attest-build-provenance@v4
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
*.tar.gz
|
||||||
|
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" *.tar.gz *.tar.gz.asc SHA256SUMS-src SHA256SUMS-src.asc
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
name: Update HTML documentation
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'man/**'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docs:
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
|
|
||||||
- name: Install groff
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y groff
|
|
||||||
|
|
||||||
- name: Generate HTML from man pages
|
|
||||||
run: |
|
|
||||||
mkdir -p doc/html/man5 doc/html/man8
|
|
||||||
echo \<html\>\<title\>3proxy documentation\</title\>\<body\>\<h2\>3proxy documentation\</h2\> >doc/html/index.html
|
|
||||||
echo \<a href=\"securityen.html\"\>Security recommendations\</a\>\<br\> >>doc/html/index.html
|
|
||||||
echo \<a href=\"highload.html\"\>Optimizing 3proxy for high loads\</a\>\<br\> >>doc/html/index.html
|
|
||||||
echo \<a href=\"howtoe.html\"\>How To \(English, very incomplete\)\</a\>\<br\> >>doc/html/index.html
|
|
||||||
echo \<a href=\"howtor.html\"\>How To \(Russian\)\</a\>\<br\> >>doc/html/index.html
|
|
||||||
echo \<a href=\"devref.html\"\>Developer reference\</a\>\<br\> >>doc/html/index.html
|
|
||||||
echo \<h3\>Man pages:\</h3\> >>doc/html/index.html
|
|
||||||
cd man
|
|
||||||
for i in *.8; do ((bash -c "groff -mandoc -Thtml $i | grep -v DOCTYPE| grep -v text/css| grep -v 'meta ' | grep -v /style | grep -v { | grep -v /title | grep -v www.w3.org | grep -v CreationDate" > ../doc/html/man8/$i.html ) && echo \<br\>\<A HREF=\"man8/$i.html\"\>$i\</A\> >> ../doc/html/index.html); done
|
|
||||||
for i in *.5; do ((bash -c "groff -mandoc -Thtml $i | grep -v DOCTYPE| grep -v text/css| grep -v 'meta ' | grep -v /style | grep -v { | grep -v /title | grep -v www.w3.org | grep -v CreationDate" > ../doc/html/man5/$i.html ) && echo \<br\>\<A HREF=\"man5/$i.html\"\>$i\</A\> >> ../doc/html/index.html); done
|
|
||||||
cd ..
|
|
||||||
echo \</body\>\</html\> >>doc/html/index.html
|
|
||||||
|
|
||||||
- name: Commit
|
|
||||||
run: |
|
|
||||||
if [ -z "$(git status --porcelain doc/html)" ]; then
|
|
||||||
echo "documentation already up to date"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add doc/html
|
|
||||||
git commit -m "Update HTML documentation from man pages"
|
|
||||||
git push
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
name: Update wiki
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'doc/html/**'
|
|
||||||
workflow_run:
|
|
||||||
workflows: ["Update HTML documentation"]
|
|
||||||
types: [completed]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: update-wiki
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
wiki:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
|
|
||||||
- name: Clone wiki
|
|
||||||
run: |
|
|
||||||
git clone --quiet \
|
|
||||||
"https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git" wiki
|
|
||||||
|
|
||||||
- name: Copy documentation
|
|
||||||
run: |
|
|
||||||
cp -f doc/html/man8/3proxy.8.html wiki/3proxy.md
|
|
||||||
cp -f doc/html/man8/3proxy_crypt.8.html wiki/3proxy_crypt.md
|
|
||||||
cp -f doc/html/man8/ftppr.8.html wiki/ftppr.md
|
|
||||||
cp -f doc/html/man8/pop3p.8.html wiki/pop3p.md
|
|
||||||
cp -f doc/html/man8/imapp.8.html wiki/imapp.md
|
|
||||||
cp -f doc/html/man8/proxy.8.html wiki/proxy.md
|
|
||||||
cp -f doc/html/man8/smtpp.8.html wiki/smtpp.md
|
|
||||||
cp -f doc/html/man8/socks.8.html wiki/socks.md
|
|
||||||
cp -f doc/html/man8/tlspr.8.html wiki/tlspr.md
|
|
||||||
cp -f doc/html/man8/tcppm.8.html wiki/tcppm.md
|
|
||||||
cp -f doc/html/man8/udppm.8.html wiki/udppm.md
|
|
||||||
cp -f doc/html/man5/3proxy.cfg.5.html wiki/3proxy.cfg.md
|
|
||||||
cp -f doc/html/highload.html wiki/High-Load.md
|
|
||||||
cp -f doc/html/howtoe.html wiki/How-To.md
|
|
||||||
cp -f doc/html/howtor.html "wiki/How-To-(русский).md"
|
|
||||||
cp -f doc/html/securityen.html wiki/Security-recommendations.md
|
|
||||||
cp -f doc/html/devel/devref.html wiki/DevelopeReference.md
|
|
||||||
cp -f doc/html/plugins/TransparentPlugin.html wiki/TransparentPlugin.md
|
|
||||||
cp -f doc/html/plugins/StringsPlugin.html wiki/StringsPlugin.md
|
|
||||||
cp -f doc/html/plugins/TrafficPlugin.html wiki/TrafficPlugin.md
|
|
||||||
cp -f doc/html/plugins/WindowsAuthentication.html wiki/WindowsAuthentication.md
|
|
||||||
cp -f doc/html/plugins/TransparentPlugin.ru.html "wiki/TransparentPlugin-(русский).md"
|
|
||||||
cp -f doc/html/plugins/StringsPlugin.ru.html "wiki/StringsPlugin-(русский).md"
|
|
||||||
cp -f doc/html/plugins/TrafficPlugin.ru.html "wiki/TrafficPlugin-(русский).md"
|
|
||||||
cp -f doc/html/plugins/WindowsAuthentication.ru.html "wiki/WindowsAuthentication-(русский).md"
|
|
||||||
|
|
||||||
- name: Commit
|
|
||||||
run: |
|
|
||||||
cd wiki
|
|
||||||
if [ -z "$(git status --porcelain)" ]; then
|
|
||||||
echo "wiki already up to date"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
git status --short
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add -A
|
|
||||||
git commit -m "Update documentation from master"
|
|
||||||
git push
|
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
3proxy-1.0.0 Released August, 22 2026
|
3proxy-0.9.9.3 Released November, 7 2026
|
||||||
|
|
||||||
No changes in 3proxy code, this release only changes how packages are built, signed and published.
|
! Fix: RADIUS authentication: the reply digest copied the shared secret right after the received bytes, so a reply of 4100 bytes with a secret of 17 or more characters wrote up to 47 bytes of it past the reply buffer on the stack, before the reply was authenticated; the digest is hashed over the reply and the secret in place now, with nothing written past the reply, and a reply is taken only from the address and port of the server the request went to, with the request's identifier and length, which was never checked before
|
||||||
|
! Fix: the PTR answer of a name server could write past the answer buffer on the stack: the label walk ran to the end of the whole message instead of the end of the record's data and could take a compression pointer for a label length (an answer of 3841 bytes or more reached past the buffer itself); the walk now stops at the end of the record's data, and a compressed, empty or truncated name is not accepted
|
||||||
! Fix: TLS, PCRE2 and PAM support was silently left out when 3proxy was built on a system whose /bin/sh is not dash, which is every RPM based distribution and macOS; the library checks built their test program with echo and escape sequences, which only dash expands, so every check failed and the features were dropped without a diagnostic
|
! Fix: every connection matching a pcre: (or regex:) rule matched on the one match data block of the rule, which pcre2_match() writes into: two connections matching at the same time raced and corrupted memory, bringing the process down under load; a connection now makes a match data block of its own
|
||||||
! Fix: rpm packages were built on Ubuntu and required glibc 2.38, libssl.so.3 and libpcre2-8, which no RPM based distribution provides, so they could not be installed anywhere; they are built against AlmaLinux 8, 9 and 10 now and carry an el8, el9 or el10 tag, covering RHEL, AlmaLinux, Rocky and CentOS Stream of the same version
|
! Fix: TLS: a read which could only be done once a write was, or a write once a read was (a TLS 1.3 key update answered while the socket cannot take more, for example), ended the connection with an error; each TLS socket remembers now what its pending read and write wait for, and the poll of the TLS layer waits for that
|
||||||
! Fix: the rpm package depended on its own interpreter, /bin/3proxy, taken from the first line of the installed configuration file, and could not be installed on el9 or el10 because rpm resolves that dependency to /usr/bin/3proxy
|
! Fix: Windows: a TLS read or write which wanted the socket again was not seen as one and dropped the connection with an unrelated error: the C library's errno was set where the socket error is read
|
||||||
! Fix: deb packages required glibc 2.38 and libssl3t64 and installed on Ubuntu 24.04 and newer only; they are built against Ubuntu 22.04 now and install on Ubuntu 22.04 and later as well as Debian 12 and later
|
! Fix: a client of a connect back (-R) service stayed in accept() for the connection another client of the same service took, until the next one came, past its time out and through a configuration reload; the connect back socket is non-blocking now, and an accept() with nothing to take does not count as one of the client's tries
|
||||||
+ Signed apt and dnf repositories are published at https://3proxy.org/repo/ in two channels: current, built from the master branch, and lts, built from the 0.9 branch; packages and repository metadata are both signed
|
! Fix: ftppr: the answer of a server which logs in on USER alone (230, as anonymous FTP often does) or refuses the login was read but never handed to the client, which was left waiting for the answer to its PASS until the time out (#1284)
|
||||||
+ Release binaries are published with SHA256 checksums, an OpenPGP signature and a GitHub build provenance attestation; docker images are signed and attested as well
|
! Fix: plugins: StringsPlugin, cutting a string table line at its end, wrote NULs past the line, into what the buffer kept of longer lines read before or past its end; FilePlugin passed the TLS state of the connection where the client's parameters were expected, so sending a string table over a TLS connection read a TLS state as a clientparam
|
||||||
+ The release signing key is an RSA-4096 key published as 3proxy-release-key.asc in the repository; rpm 4.14 and earlier can not import an Ed25519 key at all, which would leave RHEL 8 and its derivatives unable to verify anything
|
+ -B (for TCP services but admin) splits the TLS ClientHello passed through tlspr in the middle of the server name (SNI), so DPI systems which do not reassemble it do not see the host name; use it with -ocTCP_NODELAY -osTCP_NODELAY, or the kernel may join the segments again; -s keeps the same effect where -s is not splice (#1283)
|
||||||
+ Packages are reproducible: rebuilding a release produces byte identical deb and rpm files, every timestamp is derived from the build date recorded for the release
|
+ An outgoing connection bound to an external address is bound with IP_BIND_ADDRESS_NO_PORT on Linux 4.2 and later: the port is chosen by connect() for the pair with the destination, so ports in use towards other destinations or closing in TIME_WAIT do not run the ephemeral range out; bind() no longer failed with result 12 or searched long for a port under many connections
|
||||||
- 32-bit ARM (armhf) is published as a deb package only, Enterprise Linux has no 32-bit ARM build
|
|
||||||
+11
-12
@@ -1,13 +1,12 @@
|
|||||||
3proxy-1.0.0 Вышел 22 Августа 2026
|
3proxy-0.9.9.3 Вышел 7 Ноября 2026
|
||||||
|
|
||||||
Изменений в коде 3proxy нет, этот выпуск меняет только сборку, подписывание и публикацию пакетов.
|
! Исправление: аутентификация RADIUS: дайджест ответа копировал общий секрет сразу за принятыми байтами, так что ответ размером 4100 байт с секретом в 17 и более символов записывал до 47 байт секрета за буфер ответа на стеке, ещё до проверки подлинности ответа; дайджест теперь вычисляется по ответу и секрету на месте, ничего не записывая за буфер, а ответ принимается только с адреса и порта сервера, которому был адресован запрос, с совпадающими с запросом идентификатором и длиной: раньше отправитель ответа не проверялся вовсе
|
||||||
|
! Исправление: ответ PTR от сервера имён мог записать данные за буфер ответа на стеке: обход имён шёл до конца всего сообщения вместо конца данных записи и мог принять байт-указатель сжатия за длину метки (ответ размером 3841 байт и более выходил за сам буфер); теперь обход останавливается в конце данных записи, а сжатое, пустое или обрезанное имя не принимается
|
||||||
! Исправление: поддержка TLS, PCRE2 и PAM молча не включалась при сборке в системах, где /bin/sh не dash, то есть во всех дистрибутивах на основе RPM и в macOS; проверки наличия библиотек формировали тестовую программу через echo с escape-последовательностями, которые раскрывает только dash, поэтому все проверки завершались неудачно и возможности отключались без каких-либо сообщений
|
! Исправление: каждое соединение, проверяемое правилом pcre: (или regex:), сопоставлялось с единственным блоком данных сопоставления правила, в который пишет pcre2_match(): два соединения, сопоставляемые одновременно, конкурировали за него и портили память, приводя процесс к падению под нагрузкой; теперь каждое соединение получает собственный блок данных сопоставления
|
||||||
! Исправление: пакеты rpm собирались в Ubuntu и требовали glibc 2.38, libssl.so.3 и libpcre2-8, которых нет ни в одном дистрибутиве на основе RPM, поэтому установить их было невозможно нигде; теперь они собираются в AlmaLinux 8, 9 и 10 и содержат метку el8, el9 или el10, что покрывает RHEL, AlmaLinux, Rocky и CentOS Stream соответствующей версии
|
! Исправление: TLS: чтение, возможное только после записи, или запись только после чтения (например, когда TLS 1.3 отвечает на обновление ключей, а сокет больше не принимает данные) завершало соединение с ошибкой; каждый TLS-сокет теперь помнит, чего ждут его незавершённые чтение и запись, и poll() TLS-уровня ждёт именно этого
|
||||||
! Исправление: пакет rpm зависел от собственного интерпретатора /bin/3proxy, взятого из первой строки устанавливаемого файла конфигурации, и не устанавливался в el9 и el10, поскольку rpm приводит эту зависимость к /usr/bin/3proxy
|
! Исправление: Windows: чтение или запись TLS, требующая повторного обращения к сокету, не распознавалась, и соединение завершалось с посторонней ошибкой: в месте чтения ошибки сокета устанавливалась ошибка libc (errno)
|
||||||
! Исправление: пакеты deb требовали glibc 2.38 и libssl3t64 и устанавливались только в Ubuntu 24.04 и новее; теперь они собираются в Ubuntu 22.04 и устанавливаются в Ubuntu 22.04 и новее, а также в Debian 12 и новее
|
! Исправление: клиент обратного соединения (connect back, -R) оставался в accept() в ожидании соединения, которое забрал другой клиент той же службы, до следующего соединения, переживая свой тайм-аут и перезагрузку конфигурации; сокет обратного соединения теперь неблокирующий, и accept() без соединения не считается попыткой клиента
|
||||||
+ Подписанные репозитории apt и dnf публикуются на https://3proxy.org/repo/ в двух каналах: current, собираемый из ветки master, и lts, собираемый из ветки 0.9; подписываются и пакеты, и метаданные репозитория
|
! Исправление: ftppr: ответ сервера, входящего по одному USER (230, как часто бывает у анонимного FTP) или отказывающего во входе, прочитывался, но не передавался клиенту, который оставался ждать ответа на свой PASS до тайм-аута (#1284)
|
||||||
+ Двоичные файлы релиза публикуются с контрольными суммами SHA256, подписью OpenPGP и подтверждением происхождения сборки GitHub (build provenance attestation); образы docker также подписываются и снабжаются подтверждением
|
! Исправление: плагины: StringsPlugin, обрезая строку таблицы строк на её конце, записывал NUL за строкой, в остатки в буфере от прочитанных раньше более длинных строк или за его конец; FilePlugin передавал в socksend() состояние TLS соединения вместо параметров клиента, и отправка таблицы строк по TLS-соединению читала состояние TLS как clientparam
|
||||||
+ Ключ подписи релизов — RSA-4096, опубликован в репозитории как 3proxy-release-key.asc; rpm версии 4.14 и более ранние вообще не могут импортировать ключ Ed25519, что лишило бы RHEL 8 и производные от него возможности проверки
|
+ -B (для TCP-служб, кроме admin) разбивает проходящий через tlspr ClientHello TLS посередине имени сервера (SNI), чтобы системы DPI, не собирающие его заново, не видели имя хоста; использовать вместе с -ocTCP_NODELAY -osTCP_NODELAY, иначе ядро может снова склеить сегменты; -s сохраняет тот же эффект там, где -s не означает splice (#1283)
|
||||||
+ Пакеты воспроизводимы: повторная сборка релиза даёт побайтово идентичные файлы deb и rpm, все отметки времени берутся из даты сборки, записанной для релиза
|
+ Исходящее соединение, привязываемое к внешнему адресу, на Linux 4.2 и новее привязывается с IP_BIND_ADDRESS_NO_PORT: порт выбирает connect() для пары с адресом назначения, поэтому порты, занятые соединениями к другим адресам или закрывающиеся в TIME_WAIT, больше не исчерпывают эфемерный диапазон; bind() больше не завершался с результатом 12 при большом числе соединений и не тратил миллисекунды на поиск порта
|
||||||
- Для 32-битной ARM (armhf) публикуется только пакет deb, в Enterprise Linux нет сборки для 32-битной ARM
|
|
||||||
+6
-5
@@ -51,7 +51,7 @@ option(3PROXY_USE_OPENSSL "Enable TLS/SSL support via OpenSSL (fallback when wol
|
|||||||
option(3PROXY_USE_PCRE2 "Enable PCRE2 regex filtering" ON)
|
option(3PROXY_USE_PCRE2 "Enable PCRE2 regex filtering" ON)
|
||||||
option(3PROXY_USE_PAM "Enable PAM/PamAuth" ON)
|
option(3PROXY_USE_PAM "Enable PAM/PamAuth" ON)
|
||||||
option(3PROXY_USE_ODBC "Enable ODBC support (Unix only, always ON on Windows)" OFF)
|
option(3PROXY_USE_ODBC "Enable ODBC support (Unix only, always ON on Windows)" OFF)
|
||||||
option(3PROXY_USE_SPLICE "Build Linux splice() support, slower than read/write for most traffic (Linux only)" OFF)
|
option(3PROXY_USE_SPLICE "Build Linux splice() support, used by services given -s (Linux only)" ON)
|
||||||
option(3PROXY_USE_POLL "Use poll() instead of select() (Unix only)" ON)
|
option(3PROXY_USE_POLL "Use poll() instead of select() (Unix only)" ON)
|
||||||
option(3PROXY_USE_WSAPOLL "Use WSAPoll instead of select() (Windows only)" ON)
|
option(3PROXY_USE_WSAPOLL "Use WSAPoll instead of select() (Windows only)" ON)
|
||||||
option(3PROXY_USE_NETFILTER "Enable Linux netfilter support (Linux only)" ON)
|
option(3PROXY_USE_NETFILTER "Enable Linux netfilter support (Linux only)" ON)
|
||||||
@@ -664,10 +664,7 @@ foreach(PROXY_NAME proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(${PROXY_NAME} PRIVATE
|
target_compile_definitions(${PROXY_NAME} PRIVATE WITHMAIN)
|
||||||
WITHMAIN
|
|
||||||
NOPORTMAP
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT PROXY_NAME STREQUAL "udppm")
|
if(NOT PROXY_NAME STREQUAL "udppm")
|
||||||
target_compile_definitions(${PROXY_NAME} PRIVATE NOUDPMAIN)
|
target_compile_definitions(${PROXY_NAME} PRIVATE NOUDPMAIN)
|
||||||
@@ -679,8 +676,12 @@ foreach(PROXY_NAME proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
|||||||
target_compile_definitions(${PROXY_NAME} PRIVATE ANONYMOUS)
|
target_compile_definitions(${PROXY_NAME} PRIVATE ANONYMOUS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# port mappers take port, host and port as arguments, the others options
|
||||||
|
# only; one of the two is defined, as in src/Makefile.inc
|
||||||
if(PROXY_NAME STREQUAL "tcppm" OR PROXY_NAME STREQUAL "udppm" OR PROXY_NAME STREQUAL "tlspr")
|
if(PROXY_NAME STREQUAL "tcppm" OR PROXY_NAME STREQUAL "udppm" OR PROXY_NAME STREQUAL "tlspr")
|
||||||
target_compile_definitions(${PROXY_NAME} PRIVATE PORTMAP)
|
target_compile_definitions(${PROXY_NAME} PRIVATE PORTMAP)
|
||||||
|
else()
|
||||||
|
target_compile_definitions(${PROXY_NAME} PRIVATE NOPORTMAP)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
+4
-4
@@ -4,9 +4,9 @@
|
|||||||
# add -DWITH_ODBC to CFLAGS and -lodbc to LIBS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LIBS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
#
|
#
|
||||||
# Linux splice() support is not built by default, it is slower than the
|
# Linux splice() support is built, but used only by services given the -s
|
||||||
# read/write path for most traffic. Add -DWITHSPLICE to CFLAGS to build it,
|
# option: it is faster for large transfers and slower for small requests.
|
||||||
# it must additionally be enabled per service with the -s option.
|
# Remove -DWITHSPLICE from CFLAGS to build without it.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
PREFIX ?= 3proxy_
|
PREFIX ?= 3proxy_
|
||||||
@@ -14,7 +14,7 @@ CRYPT_PREFIX ?= $(PREFIX)
|
|||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
CFLAGS ?= -O3 -flto
|
CFLAGS ?= -O3 -flto
|
||||||
CFLAGS += -fno-strict-aliasing -c -pthread -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER -D WITH_UN
|
CFLAGS += -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER -D WITH_UN
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= ${CC}
|
LN ?= ${CC}
|
||||||
DCFLAGS ?= -fPIC
|
DCFLAGS ?= -fPIC
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
|
|
||||||
- **Master** (current/latest) branch - 3proxy 1.0
|
- **Master** (stable) branch - 3proxy 1.0
|
||||||
- **0.9** (LTS) branch - 3proxy 0.9.9.x
|
- **0.9** (LTS) branch - 3proxy 0.9 maintenance branch, this branch
|
||||||
- **Devel** branch - 3proxy 2.0-devel (don't use it)
|
- **Devel** branch - 3proxy 2.0-devel (don't use it)
|
||||||
|
|
||||||
### Binaries (deb / rpm / Windows zip)
|
### Binaries (deb / rpm / Windows zip)
|
||||||
@@ -17,7 +17,7 @@ https://github.com/3proxy/3proxy/releases
|
|||||||
### Package repository (apt / dnf)
|
### Package repository (apt / dnf)
|
||||||
|
|
||||||
Signed apt and dnf repositories are published at https://3proxy.org/repo/ in
|
Signed apt and dnf repositories are published at https://3proxy.org/repo/ in
|
||||||
two channels: `current` (master) and `lts` (0.9 branch).
|
two channels: `lts` (0.9 branch) and `current` (master).
|
||||||
|
|
||||||
Debian 12 and Ubuntu 22.04 or newer:
|
Debian 12 and Ubuntu 22.04 or newer:
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ sudo curl -fsSL https://3proxy.org/repo/3proxy-release-key.asc \
|
|||||||
sudo tee /etc/apt/sources.list.d/3proxy.sources <<EOF
|
sudo tee /etc/apt/sources.list.d/3proxy.sources <<EOF
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://3proxy.org/repo/deb
|
URIs: https://3proxy.org/repo/deb
|
||||||
Suites: current
|
Suites: lts
|
||||||
Components: main
|
Components: main
|
||||||
Signed-By: /usr/share/keyrings/3proxy.asc
|
Signed-By: /usr/share/keyrings/3proxy.asc
|
||||||
EOF
|
EOF
|
||||||
@@ -40,7 +40,7 @@ AlmaLinux, RHEL, Rocky and CentOS Stream 8, 9 and 10:
|
|||||||
sudo tee /etc/yum.repos.d/3proxy.repo <<EOF
|
sudo tee /etc/yum.repos.d/3proxy.repo <<EOF
|
||||||
[3proxy]
|
[3proxy]
|
||||||
name=3proxy
|
name=3proxy
|
||||||
baseurl=https://3proxy.org/repo/rpm/current/el\$releasever/\$basearch/
|
baseurl=https://3proxy.org/repo/rpm/lts/el\$releasever/\$basearch/
|
||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=1
|
gpgcheck=1
|
||||||
repo_gpgcheck=1
|
repo_gpgcheck=1
|
||||||
@@ -50,7 +50,7 @@ sudo dnf install 3proxy
|
|||||||
```
|
```
|
||||||
|
|
||||||
Both the packages and the repository metadata are signed. See
|
Both the packages and the repository metadata are signed. See
|
||||||
https://3proxy.org/repo/ for the `lts` channel and for release key details.
|
https://3proxy.org/repo/ for the `current` channel and for release key details.
|
||||||
|
|
||||||
### Docker images
|
### Docker images
|
||||||
|
|
||||||
@@ -68,11 +68,9 @@ Documentation (man pages and HTML) available with download, on https://3proxy.or
|
|||||||
|
|
||||||
## Docker images
|
## Docker images
|
||||||
|
|
||||||
3 docker configurations are provided, default (full) also tagged as `:latest`, `:busybox` and `:minimal`, all refer to newest stable version. Except busybox, images are distroless and contain only binaries, you can not sh inside the container. `:busybox` contains busybox shell. Images are based on current (master) branch.
|
3 docker configurations are provided, default (full) also tagged as `:lts`, `:lts-busybox` and `:lts-minimal`, all refer to newest 0.9 LTS version. Images built from this branch use the `lts` tags, images built from the master branch use `:latest`, `:busybox` and `:minimal`. Use the `lts` tags to stay on the 0.9 branch, use a version tag (e.g. `:0.9.9`) to pin an exact version. Except busybox, images are distroless and contain only binaries, you can not sh inside the container. `:lts-busybox` contains busybox shell.
|
||||||
|
|
||||||
Images marked as LTS (`:lts`, `:lts-busybox`, `:lts-minimal`) are built from LTS branch (0.9.9.x)
|
### Default image (`:lts`):
|
||||||
|
|
||||||
### Default image (`:latest`):
|
|
||||||
|
|
||||||
Full installation requires to mount /etc/3proxy/3proxy.cfg files.
|
Full installation requires to mount /etc/3proxy/3proxy.cfg files.
|
||||||
|
|
||||||
@@ -83,7 +81,7 @@ echo "log
|
|||||||
nserver 8.8.8.8
|
nserver 8.8.8.8
|
||||||
nscache 65536
|
nscache 65536
|
||||||
proxy -p3129" | docker config create 3proxy
|
proxy -p3129" | docker config create 3proxy
|
||||||
docker run --read-only -p 3129:3129 --config source=3proxy,target=/etc/3proxy/3proxy.cfg --name 3proxy.full docker.io/3proxy/3proxy
|
docker run --read-only -p 3129:3129 --config source=3proxy,target=/etc/3proxy/3proxy.cfg --name 3proxy.full docker.io/3proxy/3proxy:lts
|
||||||
```
|
```
|
||||||
|
|
||||||
`podman` does not support `config` as above.
|
`podman` does not support `config` as above.
|
||||||
@@ -101,13 +99,13 @@ podman run --read-only -p 3129:3129 -v /path/to/local/config/directory/3proxy.cf
|
|||||||
use `log` without pathname in config to log to stdout.
|
use `log` without pathname in config to log to stdout.
|
||||||
plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config) and since 0.9.6 symlinked by /lib and /lib64 in both chroot and non-chroot configurations, so no full path is required in `plugin` command. Use e.g. `plugin SSLPlugin.ls.so ssl_plugin`. SSLPlugin is supported since 0.9.6. Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. -`-network host` mode or `-P` for `docker run`.
|
plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config) and since 0.9.6 symlinked by /lib and /lib64 in both chroot and non-chroot configurations, so no full path is required in `plugin` command. Use e.g. `plugin SSLPlugin.ls.so ssl_plugin`. SSLPlugin is supported since 0.9.6. Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. -`-network host` mode or `-P` for `docker run`.
|
||||||
|
|
||||||
since 0.9.6 images are distroless (except :busybox) it's recommended to use with read only file system, there are no benefits from chroot. For compatibility, you still can use chroot installation by mounting directory with 3proxy.cfg to /usr/local/3proxy/config.
|
since 0.9.6 images are distroless (except :lts-busybox) it's recommended to use with read only file system, there are no benefits from chroot. For compatibility, you still can use chroot installation by mounting directory with 3proxy.cfg to /usr/local/3proxy/config.
|
||||||
|
|
||||||
### Busybox image (`:busybox`):
|
### Busybox image (`:lts-busybox`):
|
||||||
|
|
||||||
`full` with busybox added, to allow `sh` and few more commands like `sed` inside container. All libraries are in /lib, so chroot configuration can not use plugins.
|
`full` with busybox added, to allow `sh` and few more commands like `sed` inside container. All libraries are in /lib, so chroot configuration can not use plugins.
|
||||||
|
|
||||||
### Interactive `:minimal` image:
|
### Interactive `:lts-minimal` image:
|
||||||
|
|
||||||
Dockerfile for "interactive" minimal 3proxy execution, no configuration mounting is required, configuration
|
Dockerfile for "interactive" minimal 3proxy execution, no configuration mounting is required, configuration
|
||||||
is accepted from stdin. Use `end` command to indicate the end of configuration. Use `log` for stdout logging.
|
is accepted from stdin. Use `end` command to indicate the end of configuration. Use `log` for stdout logging.
|
||||||
@@ -117,7 +115,7 @@ since 0.9.6 images are distroless (except :busybox) it's recommended to use with
|
|||||||
|
|
||||||
Run example:
|
Run example:
|
||||||
|
|
||||||
`docker run --read-only -i -p 3129:3129 --name 3proxy docker.io/3proxy/3proxy:minimal`
|
`docker run --read-only -i -p 3129:3129 --name 3proxy docker.io/3proxy/3proxy:lts-minimal`
|
||||||
or
|
or
|
||||||
`docker start -ai 3proxy` to start existing container
|
`docker start -ai 3proxy` to start existing container
|
||||||
|
|
||||||
@@ -133,7 +131,7 @@ end
|
|||||||
|
|
||||||
Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. `--network host` mode or `-P` to `docker run`.
|
Some proxy types (e.g. SOCKSv5 UDPASSCOC, SOCKSv5 BIND functionality, ftp proxy) require access to ephemeral port, you may use e.g. `--network host` mode or `-P` to `docker run`.
|
||||||
|
|
||||||
`:minimal` without version specified uses current stable version.
|
`:lts-minimal` without version specified uses current 0.9 LTS version.
|
||||||
|
|
||||||
## Building and installation
|
## Building and installation
|
||||||
|
|
||||||
|
|||||||
+15
-5
@@ -15,8 +15,8 @@ For High/Critical patched version is released within 2 weeks
|
|||||||
|
|
||||||
## Verifying downloads
|
## Verifying downloads
|
||||||
|
|
||||||
Release binaries are published with SHA256 checksums, an OpenPGP signature and
|
Release binaries and the source tarball are published with SHA256 checksums, an
|
||||||
a GitHub build provenance attestation.
|
OpenPGP signature and a GitHub build provenance attestation.
|
||||||
|
|
||||||
The release signing key is `3proxy-release-key.asc` in the root of this
|
The release signing key is `3proxy-release-key.asc` in the root of this
|
||||||
repository, an RSA-4096 key:
|
repository, an RSA-4096 key:
|
||||||
@@ -40,6 +40,18 @@ gpg --verify SHA256SUMS-x86_64.asc SHA256SUMS-x86_64
|
|||||||
sha256sum -c SHA256SUMS-x86_64
|
sha256sum -c SHA256SUMS-x86_64
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The source tarball published with each release is signed as well:
|
||||||
|
|
||||||
|
```
|
||||||
|
gpg --verify SHA256SUMS-src.asc SHA256SUMS-src
|
||||||
|
sha256sum -c SHA256SUMS-src
|
||||||
|
gpg --verify 3proxy-0.9.9.tar.gz.asc 3proxy-0.9.9.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
Prefer it over the `Source code (tar.gz)` link GitHub generates automatically:
|
||||||
|
only the published tarball is signed. It is produced with `git archive` from
|
||||||
|
the release tag, so it can be regenerated and compared byte for byte.
|
||||||
|
|
||||||
RPM packages are signed, the signature is checked by rpm itself:
|
RPM packages are signed, the signature is checked by rpm itself:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -58,7 +70,5 @@ verified with the GitHub CLI:
|
|||||||
|
|
||||||
```
|
```
|
||||||
gh attestation verify 3proxy-0.9.9.x86_64.rpm --owner 3proxy
|
gh attestation verify 3proxy-0.9.9.x86_64.rpm --owner 3proxy
|
||||||
gh attestation verify oci://docker.io/3proxy/3proxy:latest --owner 3proxy
|
gh attestation verify oci://docker.io/3proxy/3proxy:lts --owner 3proxy
|
||||||
```
|
```
|
||||||
|
|
||||||
Windows binaries are Authenticode signed in addition to the above.
|
|
||||||
Vendored
+21
-3
@@ -1,8 +1,26 @@
|
|||||||
3proxy (1.0.0-1) buster; urgency=medium
|
3proxy (0.9.9.3-1) buster; urgency=medium
|
||||||
|
|
||||||
*3proxy 1.0.0 initial build
|
*3proxy 0.9.9.3 initial build
|
||||||
|
|
||||||
-- z3APA3A <3apa3a@3proxy.org> Sat, 22 Aug 2026 12:13:00 +0000
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 07 Nov 2026 09:14:32 +0000
|
||||||
|
|
||||||
|
3proxy (0.9.9.2-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.9.2 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 24 Oct 2026 12:03:57 +0000
|
||||||
|
|
||||||
|
3proxy (0.9.9.1-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.9.1 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 10 Oct 2026 16:57:17 +0000
|
||||||
|
|
||||||
|
3proxy (0.9.9.0-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.9.0 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Thu, 20 Aug 2026 19:12:35 +0300
|
||||||
|
|
||||||
3proxy (0.9.9-1) buster; urgency=medium
|
3proxy (0.9.9-1) buster; urgency=medium
|
||||||
|
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,12 @@
|
|||||||
|
! Fix: crash (segmentation fault) on configuration reload (SIGUSR1) on a busy server: a closing session could still use its service after the reload had freed it; the race existed since 0.9.7, the 5 second linger added in 0.9.9 made it much more likely (#1278)
|
||||||
|
! Fix: -Di and -De (bind to interface) were not applied to SOCKSv5 UDP ASSOCIATE and BIND sockets, the FTP proxy data connection and connect back (#1277)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE over IPv6: the source address of a datagram was truncated and the reply was sent to the wrong address (#1279)
|
||||||
|
! Fix: SOCKSv5 UDP ASSOCIATE: an access rule with host names matched any datagram sent to a literal address; the address is used as the host name now, as it is for TCP requests
|
||||||
|
! Fix: buffer could be insufficient for the headers the HTTP proxy adds after a pcre_rewrite had grown the request
|
||||||
|
! Fix: heap buffer overflow in pcre_rewrite: a $N reference to a group which did not match was written out as its digits, which the space allocated for the result did not count
|
||||||
|
! Fix: pcre_extend did nothing, the rules it appended were never consulted
|
||||||
|
! Fix: certificates generated for TLS MitM (openssl) carried no subject and authority key identifiers and were refused by strict verifiers, including macOS clients, OpenSSL with x509_strict and Python 3.13
|
||||||
|
! Fix: null pointer dereference in ftppr on PASS without USER and in smtpp on a user name without a host
|
||||||
|
! Fix: no service started with wolfSSL on glibc: the default thread stack was too small for wolfSSL thread-local storage, pthread_create() failed and the failure was not reported
|
||||||
|
! Fix: dnspr did not work on Windows, the socket it answers from could not be bound
|
||||||
|
- Windows binaries are no longer signed with a self-signed Authenticode certificate, it gave no trust and triggered antivirus false positives
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
! Fix: dnspr relayed to the client whatever came first to the socket it asked the name server from, from any address and under any id, so a forged answer could be passed on; the query now goes out under a random id, and only an answer from the name server asked, with that id and the same question, is relayed
|
||||||
|
! Fix: a client sending a part of a TLS record and then nothing kept a thread taking all of a CPU, and the read never timed out
|
||||||
|
! Fix: without -Ne, the reply to SOCKS CONNECT and BIND gave the address of the client's connection to the proxy instead of the socket towards the destination: a BIND client was told the proxy's own port and the peer could never reach it (since 0.9.6)
|
||||||
|
! Fix: a client which shut down its sending side (half-close) could get the answer cut short, megabytes short with large answers; likewise an upload after the server half-closed
|
||||||
|
! Fix: with chroot every local time was UTC and every syslog message was lost: the time zone is loaded and syslog connected before chroot; the chroot entry of 3proxy.cfg(5) lists what PAM, LDAP and ODBC still need inside the chroot
|
||||||
|
! Fix: the HTTP proxy closed the server connection of a kept-alive client and opened another one when only the request method changed (a POST after a GET to the same host)
|
||||||
|
! Fix: the last ssl_client_mode in the configuration applied to every service, and a reload changed it for the services still running
|
||||||
|
! Fix: memory leaks: on every refused configuration reload, on every failed TLS handshake, the server CA paths of every TLS service
|
||||||
|
! Fix: Unix sockets: on Linux a proxy listening on a Unix socket relayed only the first bytes of an answer (result 95); an abstract socket (unix:@NAME) was bound under a name padded with zeros, which clients did not reach; tcppm refused port 0 for a unix: target, as given in the manual's example; on a reload the socket file of a listening service was removed
|
||||||
|
! Fix: SIGPIPE could kill 3proxy when a client was gone while services were starting, and standalone services (proxy, socks, ...) at any time; sends use MSG_NOSIGNAL where the system has it
|
||||||
|
! Fix: TLS MitM failed for every connection with wolfSSL built with WOLFSSL_QT (wolfSSL 5.9.1 of Ubuntu 26.04): the source certificate's serial number could not be copied; a serial number made from the hash of the source certificate is used then
|
||||||
|
! Fix: Windows: closing a connection could leave its socket open (SO_LINGER on a non-blocking socket) or reset it while the peer still sent, so the end of an answer could be lost
|
||||||
|
! Fix: standalone port mappers (tcppm, udppm, tlspr) built with CMake were built as if they were not port mappers
|
||||||
|
- splice() is built by default on Linux again and is used only by services given -s
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
! Fix: RADIUS authentication: the reply digest copied the shared secret right after the received bytes, so a reply of 4100 bytes with a secret of 17 or more characters wrote up to 47 bytes of it past the reply buffer on the stack, before the reply was authenticated; the digest is hashed over the reply and the secret in place now, with nothing written past the reply, and a reply is taken only from the address and port of the server the request went to, with the request's identifier and length, which was never checked before
|
||||||
|
! Fix: the PTR answer of a name server could write past the answer buffer on the stack: the label walk ran to the end of the whole message instead of the end of the record's data and could take a compression pointer for a label length (an answer of 3841 bytes or more reached past the buffer itself); the walk now stops at the end of the record's data, and a compressed, empty or truncated name is not accepted
|
||||||
|
! Fix: every connection matching a pcre: (or regex:) rule matched on the one match data block of the rule, which pcre2_match() writes into: two connections matching at the same time raced and corrupted memory, bringing the process down under load; a connection now makes a match data block of its own
|
||||||
|
! Fix: TLS: a read which could only be done once a write was, or a write once a read was (a TLS 1.3 key update answered while the socket cannot take more, for example), ended the connection with an error; each TLS socket remembers now what its pending read and write wait for, and the poll of the TLS layer waits for that
|
||||||
|
! Fix: Windows: a TLS read or write which wanted the socket again was not seen as one and dropped the connection with an unrelated error: the C library's errno was set where the socket error is read
|
||||||
|
! Fix: a client of a connect back (-R) service stayed in accept() for the connection another client of the same service took, until the next one came, past its time out and through a configuration reload; the connect back socket is non-blocking now, and an accept() with nothing to take does not count as one of the client's tries
|
||||||
|
! Fix: ftppr: the answer of a server which logs in on USER alone (230, as anonymous FTP often does) or refuses the login was read but never handed to the client, which was left waiting for the answer to its PASS until the time out (#1284)
|
||||||
|
! Fix: plugins: StringsPlugin, cutting a string table line at its end, wrote NULs past the line, into what the buffer kept of longer lines read before or past its end; FilePlugin passed the TLS state of the connection where the client's parameters were expected, so sending a string table over a TLS connection read a TLS state as a clientparam
|
||||||
|
+ -B (for TCP services but admin) splits the TLS ClientHello passed through tlspr in the middle of the server name (SNI), so DPI systems which do not reassemble it do not see the host name; use it with -ocTCP_NODELAY -osTCP_NODELAY, or the kernel may join the segments again; -s keeps the same effect where -s is not splice (#1283)
|
||||||
|
+ An outgoing connection bound to an external address is bound with IP_BIND_ADDRESS_NO_PORT on Linux 4.2 and later: the port is chosen by connect() for the pair with the destination, so ports in use towards other destinations or closing in TIME_WAIT do not run the ephemeral range out; bind() no longer failed with result 12 or searched long for a port under many connections
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
No changes in 3proxy code, this release only changes how packages are built, signed and published.
|
|
||||||
|
|
||||||
! Fix: TLS, PCRE2 and PAM support was silently left out when 3proxy was built on a system whose /bin/sh is not dash, which is every RPM based distribution and macOS; the library checks built their test program with echo and escape sequences, which only dash expands, so every check failed and the features were dropped without a diagnostic
|
|
||||||
! Fix: rpm packages were built on Ubuntu and required glibc 2.38, libssl.so.3 and libpcre2-8, which no RPM based distribution provides, so they could not be installed anywhere; they are built against AlmaLinux 8, 9 and 10 now and carry an el8, el9 or el10 tag, covering RHEL, AlmaLinux, Rocky and CentOS Stream of the same version
|
|
||||||
! Fix: the rpm package depended on its own interpreter, /bin/3proxy, taken from the first line of the installed configuration file, and could not be installed on el9 or el10 because rpm resolves that dependency to /usr/bin/3proxy
|
|
||||||
! Fix: deb packages required glibc 2.38 and libssl3t64 and installed on Ubuntu 24.04 and newer only; they are built against Ubuntu 22.04 now and install on Ubuntu 22.04 and later as well as Debian 12 and later
|
|
||||||
+ Signed apt and dnf repositories are published at https://3proxy.org/repo/ in two channels: current, built from the master branch, and lts, built from the 0.9 branch; packages and repository metadata are both signed
|
|
||||||
+ Release binaries are published with SHA256 checksums, an OpenPGP signature and a GitHub build provenance attestation; docker images are signed and attested as well
|
|
||||||
+ The release signing key is an RSA-4096 key published as 3proxy-release-key.asc in the repository; rpm 4.14 and earlier can not import an Ed25519 key at all, which would leave RHEL 8 and its derivatives unable to verify anything
|
|
||||||
+ Packages are reproducible: rebuilding a release produces byte identical deb and rpm files, every timestamp is derived from the build date recorded for the release
|
|
||||||
- 32-bit ARM (armhf) is published as a deb package only, Enterprise Linux has no 32-bit ARM build
|
|
||||||
@@ -646,13 +646,13 @@ see <a href="#DNSPR">How to set up a DNS proxy (dnspr)</a>.
|
|||||||
<br>tlspr can be used as a parent with the "tls" type to implement SNI splitting for DPI bypass (similar to NoDPI/GoodByeDPI).
|
<br>tlspr can be used as a parent with the "tls" type to implement SNI splitting for DPI bypass (similar to NoDPI/GoodByeDPI).
|
||||||
The client sends the first part of the TLS ClientHello, tlspr splits it at the SNI extension and sends it in two TCP packets,
|
The client sends the first part of the TLS ClientHello, tlspr splits it at the SNI extension and sends it in two TCP packets,
|
||||||
which can bypass some DPI systems that look for blocked hostnames in TLS handshakes.
|
which can bypass some DPI systems that look for blocked hostnames in TLS handshakes.
|
||||||
<br>To enable SNI break, use <code>parent ... tls 0.0.0.0 0</code> and the <code>-s</code> option on the listening service with TCP_NODELAY:
|
<br>To enable SNI break, use <code>parent ... tls 0.0.0.0 0</code> and the <code>-B</code> option on the listening service with TCP_NODELAY:
|
||||||
</p><pre>
|
</p><pre>
|
||||||
auth iponly
|
auth iponly
|
||||||
allow *
|
allow *
|
||||||
parent 1000 tls 0.0.0.0 0
|
parent 1000 tls 0.0.0.0 0
|
||||||
allow *
|
allow *
|
||||||
proxy -s -i127.0.0.1 -ocTCP_NODELAY -osTCP_NODELAY -p1443
|
proxy -B -i127.0.0.1 -ocTCP_NODELAY -osTCP_NODELAY -p1443
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
TCP_NODELAY is required to prevent the kernel from merging the split packets.
|
TCP_NODELAY is required to prevent the kernel from merging the split packets.
|
||||||
@@ -1471,10 +1471,12 @@ allowed traffic in megabytes (MB). nocountin allows you to set exclusions.
|
|||||||
For name resolution and caching, use the commands nserver, nscache / nscache6, and nsrecord.
|
For name resolution and caching, use the commands nserver, nscache / nscache6, and nsrecord.
|
||||||
<pre>
|
<pre>
|
||||||
nserver 192.168.1.2
|
nserver 192.168.1.2
|
||||||
nserver 192.168.1.3:5353/tcp</pre>
|
nserver 192.168.1.3:5353/tcp
|
||||||
|
nserver [2001:4860:4860::8844]</pre>
|
||||||
sets DNS resolvers. 192.168.1.3 will be used via TCP/5353 (instead of default UDP/53)
|
sets DNS resolvers. 192.168.1.3 will be used via TCP/5353 (instead of default UDP/53)
|
||||||
only if 192.168.1.2 fails. Up to 5 nservers may be specified.
|
only if 192.168.1.2 fails. Up to 5 nservers may be specified.
|
||||||
If no nserver is configured, default system name resolution functions are used.
|
If no nserver is configured, default system name resolution functions are used.
|
||||||
|
An IPv6 address has to be written in square brackets.
|
||||||
<pre>
|
<pre>
|
||||||
nscache 65535
|
nscache 65535
|
||||||
nscache6 65535</pre>
|
nscache6 65535</pre>
|
||||||
|
|||||||
@@ -654,13 +654,13 @@ iptables -t nat -A PREROUTING -p tcp -m multiport --dports 443,993,465 -j REDIRE
|
|||||||
<br>tlspr может использоваться как родительский прокси типа "tls" для реализации SNI-фрагментации (аналог NoDPI/GoodByeDPI).
|
<br>tlspr может использоваться как родительский прокси типа "tls" для реализации SNI-фрагментации (аналог NoDPI/GoodByeDPI).
|
||||||
Клиент отправляет первую часть TLS ClientHello, tlspr разбивает его на расширении SNI и отправляет двумя TCP-пакетами,
|
Клиент отправляет первую часть TLS ClientHello, tlspr разбивает его на расширении SNI и отправляет двумя TCP-пакетами,
|
||||||
что позволяет обойти некоторые DPI-системы, ищущие заблокированные имена хостов в TLS-рукопожатиях.
|
что позволяет обойти некоторые DPI-системы, ищущие заблокированные имена хостов в TLS-рукопожатиях.
|
||||||
<br>Для включения SNI break используйте <code>parent ... tls 0.0.0.0 0</code> и опцию <code>-s</code> на слушающем сервисе с TCP_NODELAY:
|
<br>Для включения SNI break используйте <code>parent ... tls 0.0.0.0 0</code> и опцию <code>-B</code> на слушающем сервисе с TCP_NODELAY:
|
||||||
</p><pre>
|
</p><pre>
|
||||||
auth iponly
|
auth iponly
|
||||||
allow *
|
allow *
|
||||||
parent 1000 tls 0.0.0.0 0
|
parent 1000 tls 0.0.0.0 0
|
||||||
allow *
|
allow *
|
||||||
proxy -s -i127.0.0.1 -ocTCP_NODELAY -osTCP_NODELAY -p1443
|
proxy -B -i127.0.0.1 -ocTCP_NODELAY -osTCP_NODELAY -p1443
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
TCP_NODELAY необходим, чтобы ядро не объединяло разделенные пакеты.
|
TCP_NODELAY необходим, чтобы ядро не объединяло разделенные пакеты.
|
||||||
@@ -1536,11 +1536,13 @@ socks -p1080
|
|||||||
nscache и nsrecord.
|
nscache и nsrecord.
|
||||||
<pre>
|
<pre>
|
||||||
nserver 192.168.1.2
|
nserver 192.168.1.2
|
||||||
nserver 192.168.1.3:5353/tcp</pre>
|
nserver 192.168.1.3:5353/tcp
|
||||||
|
nserver [2001:4860:4860::8844]</pre>
|
||||||
указывает 3proxy какие машины следует использвоать в качестве серверов
|
указывает 3proxy какие машины следует использвоать в качестве серверов
|
||||||
DNS. Сервер 192.168.1.3 будет использоваться по порту TCP/5353 (вместо дефолтного UDP/53) только при недостижимости
|
DNS. Сервер 192.168.1.3 будет использоваться по порту TCP/5353 (вместо дефолтного UDP/53) только при недостижимости
|
||||||
192.168.1.2. Можно указать до 5 серверов. Если nserver не указан, будут
|
192.168.1.2. Можно указать до 5 серверов. Если nserver не указан, будут
|
||||||
использованы системные функции разрешения имен.
|
использованы системные функции разрешения имен.
|
||||||
|
Адрес IPv6 необходимо записывать в квадратных скобках.
|
||||||
<pre>
|
<pre>
|
||||||
nscache 65535
|
nscache 65535
|
||||||
nscache6 65535</pre>
|
nscache6 65535</pre>
|
||||||
|
|||||||
+1
-1
@@ -5,8 +5,8 @@
|
|||||||
<a href="howtor.html">How To (Russian)</a><br>
|
<a href="howtor.html">How To (Russian)</a><br>
|
||||||
<a href="devref.html">Developer reference</a><br>
|
<a href="devref.html">Developer reference</a><br>
|
||||||
<h3>Man pages:</h3>
|
<h3>Man pages:</h3>
|
||||||
<br><A HREF="man8/3proxy.8.html">3proxy.8</A>
|
|
||||||
<br><A HREF="man8/3proxy_crypt.8.html">3proxy_crypt.8</A>
|
<br><A HREF="man8/3proxy_crypt.8.html">3proxy_crypt.8</A>
|
||||||
|
<br><A HREF="man8/3proxy.8.html">3proxy.8</A>
|
||||||
<br><A HREF="man8/ftppr.8.html">ftppr.8</A>
|
<br><A HREF="man8/ftppr.8.html">ftppr.8</A>
|
||||||
<br><A HREF="man8/imapp.8.html">imapp.8</A>
|
<br><A HREF="man8/imapp.8.html">imapp.8</A>
|
||||||
<br><A HREF="man8/pop3p.8.html">pop3p.8</A>
|
<br><A HREF="man8/pop3p.8.html">pop3p.8</A>
|
||||||
|
|||||||
+100
-89
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy.cfg</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy.cfg</b>
|
||||||
3proxy configuration file</p>
|
3proxy configuration file</p>
|
||||||
|
|
||||||
<h2>DESCRIPTION
|
<h2>DESCRIPTION
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Common
|
<p style="margin-left:6%; margin-top: 1em">Common
|
||||||
structure: <br>
|
structure: <br>
|
||||||
Configuration file is a text file 3proxy reads configuration
|
Configuration file is a text file 3proxy reads configuration
|
||||||
from. Each line of the file is a command executed
|
from. Each line of the file is a command executed
|
||||||
@@ -51,12 +51,12 @@ command line. Additional space characters are ignored. Think
|
|||||||
about 3proxy as "application level router" with
|
about 3proxy as "application level router" with
|
||||||
console interface.</p>
|
console interface.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Comments: <br>
|
<p style="margin-left:6%; margin-top: 1em">Comments: <br>
|
||||||
Any line beginning with a space character or ´#´
|
Any line beginning with a space character or ´#´
|
||||||
character is a comment. It´s ignored. <LF>s are
|
character is a comment. It´s ignored. <LF>s are
|
||||||
ignored. <CR> is the end of a command.</p>
|
ignored. <CR> is the end of a command.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Quotation: <br>
|
<p style="margin-left:6%; margin-top: 1em">Quotation: <br>
|
||||||
The quotation character is " (double quote). Quotation
|
The quotation character is " (double quote). Quotation
|
||||||
must be used to quote spaces or other special characters. To
|
must be used to quote spaces or other special characters. To
|
||||||
use a quotation character inside a quoted string, the
|
use a quotation character inside a quoted string, the
|
||||||
@@ -65,7 +65,7 @@ to use HELLO "WORLD" as an argument, you should
|
|||||||
write it as "HELLO ""WORLD""".
|
write it as "HELLO ""WORLD""".
|
||||||
Good practice is to quote any argument you use.</p>
|
Good practice is to quote any argument you use.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">File inclusion:
|
<p style="margin-left:6%; margin-top: 1em">File inclusion:
|
||||||
<br>
|
<br>
|
||||||
You can include file by using $FILENAME macro (replace
|
You can include file by using $FILENAME macro (replace
|
||||||
FILENAME with a path to file, for example
|
FILENAME with a path to file, for example
|
||||||
@@ -80,10 +80,10 @@ commands (like userlist, network lists, etc). To use dollar
|
|||||||
sign somewhere in argument it must be quoted. Recursion is
|
sign somewhere in argument it must be quoted. Recursion is
|
||||||
not allowed.</p>
|
not allowed.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Next commands
|
<p style="margin-left:6%; margin-top: 1em">Next commands
|
||||||
start gateway services:</p>
|
start gateway services:</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>proxy</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>proxy</b>
|
||||||
[options] <b><br>
|
[options] <b><br>
|
||||||
socks</b> [options] <b><br>
|
socks</b> [options] <b><br>
|
||||||
pop3p</b> [options] <b><br>
|
pop3p</b> [options] <b><br>
|
||||||
@@ -119,7 +119,7 @@ destination, the port number is ignored but must be
|
|||||||
specified for syntax compatibility. <b><br>
|
specified for syntax compatibility. <b><br>
|
||||||
udppm</b> UDP portmapper</p>
|
udppm</b> UDP portmapper</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Options: <b><br>
|
<p style="margin-left:6%; margin-top: 1em">Options: <b><br>
|
||||||
-p</b><i>NUMBER</i> change default server port to NUMBER
|
-p</b><i>NUMBER</i> change default server port to NUMBER
|
||||||
<b><br>
|
<b><br>
|
||||||
-6</b> Only resolve IPv6 addresses. IPv4 addresses are
|
-6</b> Only resolve IPv6 addresses. IPv4 addresses are
|
||||||
@@ -216,12 +216,11 @@ second. Useful to minimize polling <b><br>
|
|||||||
-s</b> <br>
|
-s</b> <br>
|
||||||
(for admin) secure, allow only secure operations, currently
|
(for admin) secure, allow only secure operations, currently
|
||||||
only traffic counters view without ability to reset. <br>
|
only traffic counters view without ability to reset. <br>
|
||||||
(for TCP services, Linux) enable splice(). splice() is not
|
(for TCP services, Linux) enable splice(). It is built on
|
||||||
built by default and is disabled even when built, because
|
Linux by default, but off unless -s is given: splice() is
|
||||||
current Linux does not implement SPLICE_F_MOVE, so no real
|
faster for large transfers and the read/write path for small
|
||||||
zero-copy takes place and the read/write path is faster for
|
requests. -s0 disables it explicitly; build without
|
||||||
most traffic. Rebuild with -DWITHSPLICE to make -s
|
-DWITHSPLICE to leave it out. <b><br>
|
||||||
available, -s0 disables it explicitly. <b><br>
|
|
||||||
-C</b> <br>
|
-C</b> <br>
|
||||||
(for TCP services) a connection closed by any of the sides
|
(for TCP services) a connection closed by any of the sides
|
||||||
terminates the session, buffered data is delivered before
|
terminates the session, buffered data is delivered before
|
||||||
@@ -286,16 +285,16 @@ FTP client does it for you. That is, if you use 3proxy with
|
|||||||
authentication use proxyuser:proxypassword:FTPuser as FTP
|
authentication use proxyuser:proxypassword:FTPuser as FTP
|
||||||
username, otherwise do not change original FTP user name</p>
|
username, otherwise do not change original FTP user name</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>include</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>include</b>
|
||||||
<i><path></i> <br>
|
<i><path></i> <br>
|
||||||
Include config file</p>
|
Include config file</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>config</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>config</b>
|
||||||
<i><path></i> <br>
|
<i><path></i> <br>
|
||||||
Path to configuration file to use on 3proxy restart or to
|
Path to configuration file to use on 3proxy restart or to
|
||||||
save configuration.</p>
|
save configuration.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>writable</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>writable</b>
|
||||||
<br>
|
<br>
|
||||||
ReOpens configuration file for write access via Web
|
ReOpens configuration file for write access via Web
|
||||||
interface, and rereads it. Usually should be first command
|
interface, and rereads it. Usually should be first command
|
||||||
@@ -303,10 +302,10 @@ on config file but in combination with config it can be used
|
|||||||
anywhere to open alternate config file. Think twice before
|
anywhere to open alternate config file. Think twice before
|
||||||
using it.</p>
|
using it.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>end</b> <br>
|
<p style="margin-left:6%; margin-top: 1em"><b>end</b> <br>
|
||||||
End of configuration</p>
|
End of configuration</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>log</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>log</b>
|
||||||
[[@|&]<i>logfile</i>] [<i><LOGTYPE></i>] <br>
|
[[@|&]<i>logfile</i>] [<i><LOGTYPE></i>] <br>
|
||||||
sets logfile for all gateways <br>
|
sets logfile for all gateways <br>
|
||||||
@ (for Unix) use syslog, filename is used as ident name <br>
|
@ (for Unix) use syslog, filename is used as ident name <br>
|
||||||
@@ -332,12 +331,12 @@ with "logformat" filename must begin with
|
|||||||
Grinwitch time zone for all time-based format
|
Grinwitch time zone for all time-based format
|
||||||
specificators.</p>
|
specificators.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>rotate</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>rotate</b>
|
||||||
<i><n></i> <br>
|
<i><n></i> <br>
|
||||||
how many archived log files to keep</p>
|
how many archived log files to keep</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>logformat</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>logformat</b>
|
||||||
<i><format></i> <br>
|
<i><format></i> <br>
|
||||||
Format for log record. First symbol in format must be L
|
Format for log record. First symbol in format must be L
|
||||||
(local time) or G (absolute Grinwitch time). It can be
|
(local time) or G (absolute Grinwitch time). It can be
|
||||||
@@ -349,7 +348,7 @@ logformat means comma and percent are replaced with space
|
|||||||
and all time based elemnts are in local time zone. <br>
|
and all time based elemnts are in local time zone. <br>
|
||||||
You can use:</p>
|
You can use:</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">%y Year in 2
|
<p style="margin-left:6%; margin-top: 1em">%y Year in 2
|
||||||
digit format <br>
|
digit format <br>
|
||||||
%Y Year in 4 digit format <br>
|
%Y Year in 4 digit format <br>
|
||||||
%m Month number <br>
|
%m Month number <br>
|
||||||
@@ -394,7 +393,7 @@ l_service, l_in, l_out, l_descr) values (´%d-%m-%Y
|
|||||||
%H:%M:%S´, ´%U´, ´%N´, %I, %O,
|
%H:%M:%S´, ´%U´, ´%N´, %I, %O,
|
||||||
´%T´)"</p>
|
´%T´)"</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>logdump</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>logdump</b>
|
||||||
<i><in_traffic_limit> <out_traffic_limit></i>
|
<i><in_traffic_limit> <out_traffic_limit></i>
|
||||||
<br>
|
<br>
|
||||||
Immediately creates additional log records if given amount
|
Immediately creates additional log records if given amount
|
||||||
@@ -404,7 +403,7 @@ to prevent information about long-lasting downloads on
|
|||||||
server shutdown.</p>
|
server shutdown.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>delimchar</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>delimchar</b>
|
||||||
<i><char></i> <br>
|
<i><char></i> <br>
|
||||||
Sets the delimiter character used to separate username from
|
Sets the delimiter character used to separate username from
|
||||||
hostname in proxy authentication strings (e.g. for FTP, POP3
|
hostname in proxy authentication strings (e.g. for FTP, POP3
|
||||||
@@ -412,14 +411,14 @@ proxies). Default is ´@´. For example, to use
|
|||||||
´#´ instead: delimchar #. This allows usernames
|
´#´ instead: delimchar #. This allows usernames
|
||||||
to contain the ´@´ character.</p>
|
to contain the ´@´ character.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>archiver</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>archiver</b>
|
||||||
<i><ext> <commandline></i> <br>
|
<i><ext> <commandline></i> <br>
|
||||||
Archiver to use for log files. <ext> is file extension
|
Archiver to use for log files. <ext> is file extension
|
||||||
produced by archiver. Filename will be last argument to
|
produced by archiver. Filename will be last argument to
|
||||||
archiver, optionally you can use %A as produced archive name
|
archiver, optionally you can use %A as produced archive name
|
||||||
and %F as filename.</p>
|
and %F as filename.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>timeouts</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>timeouts</b>
|
||||||
<i><BYTE_SHORT> <BYTE_LONG> <STRING_SHORT>
|
<i><BYTE_SHORT> <BYTE_LONG> <STRING_SHORT>
|
||||||
<STRING_LONG> <CONNECTION_SHORT>
|
<STRING_LONG> <CONNECTION_SHORT>
|
||||||
<CONNECTION_LONG> <DNS> <CHAIN>
|
<CONNECTION_LONG> <DNS> <CHAIN>
|
||||||
@@ -450,14 +449,14 @@ tail of the data to be lost on slow connections, too large
|
|||||||
one delays release of the sockets. <br>
|
one delays release of the sockets. <br>
|
||||||
default timeouts 1 5 30 60 180 1800 15 60 15 5 5</p>
|
default timeouts 1 5 30 60 180 1800 15 60 15 5 5</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>maxseg</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>maxseg</b>
|
||||||
<i><value></i> <br>
|
<i><value></i> <br>
|
||||||
Sets TCP maximum segment size (MSS) for outgoing
|
Sets TCP maximum segment size (MSS) for outgoing
|
||||||
connections. This can be used to work around path MTU
|
connections. This can be used to work around path MTU
|
||||||
discovery issues or to optimize traffic for specific network
|
discovery issues or to optimize traffic for specific network
|
||||||
conditions.</p>
|
conditions.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>radius</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>radius</b>
|
||||||
<i><NAS_SECRET>
|
<i><NAS_SECRET>
|
||||||
<radius_server_1</i>[:<i>port</i>][/<i>local_address_1</i>]
|
<radius_server_1</i>[:<i>port</i>][/<i>local_address_1</i>]
|
||||||
<i><radius_server_2</i>[:<i>port</i>][/<i>local_address_2</i>]
|
<i><radius_server_2</i>[:<i>port</i>][/<i>local_address_2</i>]
|
||||||
@@ -484,21 +483,25 @@ user), Reply-Message. Use <b>authcache</b> to speedup
|
|||||||
authentication. RADIUS feature is currently
|
authentication. RADIUS feature is currently
|
||||||
experimental.</p>
|
experimental.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>nserver</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>nserver</b>
|
||||||
<i><ipaddr></i>[:<i>port</i>][/<i>tcp</i>] <br>
|
<i><ipaddr></i>[:<i>port</i>][/<i>tcp</i>] <br>
|
||||||
Nameserver to use for name resolutions. If none specified
|
Nameserver to use for name resolutions. If none specified
|
||||||
system routines for name resolution is used. Optional port
|
system routines for name resolution is used. Optional port
|
||||||
number may be specified. If optional /tcp is added to IP
|
number may be specified. If optional /tcp is added to IP
|
||||||
address, name resolution is performed over TCP.</p>
|
address, name resolution is performed over TCP. An IPv6 address
|
||||||
|
has to be enclosed in square brackets: <br>
|
||||||
|
<b>nserver 1.1.1.1</b> <br>
|
||||||
|
<b>nserver [2001:4860:4860::8844]</b> <br>
|
||||||
|
<b>nserver [2001:4860:4860::8844]:5353/tcp</b></p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>authnserver</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>authnserver</b>
|
||||||
<i><ipaddr></i>[:<i>port</i>][/<i>tcp</i>] <br>
|
<i><ipaddr></i>[:<i>port</i>][/<i>tcp</i>] <br>
|
||||||
Nameserver to use for DNS-based authentication (e.g. dnsname
|
Nameserver to use for DNS-based authentication (e.g. dnsname
|
||||||
auth type). If not specified, nserver is used. The syntax is
|
auth type). If not specified, nserver is used. The syntax is
|
||||||
the same as for nserver.</p>
|
the same as for nserver.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>nscache</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>nscache</b>
|
||||||
<i><cachesize></i> <b>nscache6</b>
|
<i><cachesize></i> <b>nscache6</b>
|
||||||
<i><cachesize></i> <br>
|
<i><cachesize></i> <br>
|
||||||
Cache <i><cachesize></i> records for name resolution
|
Cache <i><cachesize></i> records for name resolution
|
||||||
@@ -506,7 +509,7 @@ Cache <i><cachesize></i> records for name resolution
|
|||||||
cache size should usually be large enough (for example,
|
cache size should usually be large enough (for example,
|
||||||
65536).</p>
|
65536).</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>nsrecord</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>nsrecord</b>
|
||||||
<i><hostname> <hostaddr></i> <br>
|
<i><hostname> <hostaddr></i> <br>
|
||||||
Adds static record to nscache. <b>nscache</b> must be
|
Adds static record to nscache. <b>nscache</b> must be
|
||||||
enabled. If 0.0.0.0 is used as a hostaddr host will never
|
enabled. If 0.0.0.0 is used as a hostaddr host will never
|
||||||
@@ -514,14 +517,14 @@ resolve, it can be used to blacklist something or together
|
|||||||
with <b>dialer</b> command to set up UDL for dialing.</p>
|
with <b>dialer</b> command to set up UDL for dialing.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>fakeresolve</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>fakeresolve</b>
|
||||||
<br>
|
<br>
|
||||||
All names are resolved to the 127.0.0.2 address. Useful if
|
All names are resolved to the 127.0.0.2 address. Useful if
|
||||||
all requests are redirected to a parent proxy with
|
all requests are redirected to a parent proxy with
|
||||||
<b>http</b>, <b>socks4+</b>, <b>connect+</b> or
|
<b>http</b>, <b>socks4+</b>, <b>connect+</b> or
|
||||||
<b>socks5+</b>.</p>
|
<b>socks5+</b>.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>dialer</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>dialer</b>
|
||||||
<i><progname></i> <br>
|
<i><progname></i> <br>
|
||||||
Execute progname if external name can´t be resolved.
|
Execute progname if external name can´t be resolved.
|
||||||
Hint: if you use nscache, dialer may not work, because names
|
Hint: if you use nscache, dialer may not work, because names
|
||||||
@@ -529,7 +532,7 @@ will be resolved through cache. In this case you can use
|
|||||||
something like http://dial.right.now/ from browser to set up
|
something like http://dial.right.now/ from browser to set up
|
||||||
connection.</p>
|
connection.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>internal</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>internal</b>
|
||||||
<i><ipaddr></i> <br>
|
<i><ipaddr></i> <br>
|
||||||
sets ip address of internal interface. This IP address will
|
sets ip address of internal interface. This IP address will
|
||||||
be used to bind gateways. Alternatively you can use -i
|
be used to bind gateways. Alternatively you can use -i
|
||||||
@@ -543,7 +546,7 @@ Unix sockets are supported with the syntax
|
|||||||
using Unix sockets, the socket file is automatically created
|
using Unix sockets, the socket file is automatically created
|
||||||
and removed on service start/stop.</p>
|
and removed on service start/stop.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>external</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>external</b>
|
||||||
<i><ipaddr></i> <br>
|
<i><ipaddr></i> <br>
|
||||||
sets ip address of external interface. This IP address will
|
sets ip address of external interface. This IP address will
|
||||||
be source address for all connections made by proxy.
|
be source address for all connections made by proxy.
|
||||||
@@ -552,7 +555,7 @@ address for gateway. Since 0.8 version External or <b>-e</b>
|
|||||||
can be given twice: once with IPv4 and once with IPv6
|
can be given twice: once with IPv4 and once with IPv6
|
||||||
address.</p>
|
address.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>maxconn</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>maxconn</b>
|
||||||
<i><number></i> <br>
|
<i><number></i> <br>
|
||||||
sets the maximum number of simultaneous connections to each
|
sets the maximum number of simultaneous connections to each
|
||||||
service started after this command at the network level.
|
service started after this command at the network level.
|
||||||
@@ -562,13 +565,13 @@ will silently ignore new connections, while <b>connlim</b>
|
|||||||
will report back to the client that the connection limit has
|
will report back to the client that the connection limit has
|
||||||
been reached.</p>
|
been reached.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>backlog</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>backlog</b>
|
||||||
<br>
|
<br>
|
||||||
sets the listening socket backlog of new connections.
|
sets the listening socket backlog of new connections.
|
||||||
Default is 1 + <b>maxconn</b>/8. Maximum value is capped by
|
Default is 1 + <b>maxconn</b>/8. Maximum value is capped by
|
||||||
kernel tunable somaxconn.</p>
|
kernel tunable somaxconn.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>service</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>service</b>
|
||||||
<br>
|
<br>
|
||||||
(deprecated). Indicates that 3proxy should behave as a
|
(deprecated). Indicates that 3proxy should behave as a
|
||||||
Windows 95/98/NT/2000/XP service; has no effect under Unix.
|
Windows 95/98/NT/2000/XP service; has no effect under Unix.
|
||||||
@@ -576,7 +579,7 @@ Not required for 3proxy 0.6 and above. If you upgraded from
|
|||||||
a previous version of 3proxy, use --remove and --install to
|
a previous version of 3proxy, use --remove and --install to
|
||||||
reinstall the service.</p>
|
reinstall the service.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>daemon</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>daemon</b>
|
||||||
<br>
|
<br>
|
||||||
Should be specified to close the console. Do not use
|
Should be specified to close the console. Do not use
|
||||||
´daemon´ with ´service´. At least
|
´daemon´ with ´service´. At least
|
||||||
@@ -584,7 +587,7 @@ under FreeBSD, <b>daemon</b> should precede any proxy
|
|||||||
service and log commands to avoid socket problems. Always
|
service and log commands to avoid socket problems. Always
|
||||||
place it in the beginning of the configuration file.</p>
|
place it in the beginning of the configuration file.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>auth</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>auth</b>
|
||||||
<i><authtype></i> [...] <br>
|
<i><authtype></i> [...] <br>
|
||||||
Type of user authorization. Currently supported: <b><br>
|
Type of user authorization. Currently supported: <b><br>
|
||||||
none</b> - no authentication or authorization required. <br>
|
none</b> - no authentication or authorization required. <br>
|
||||||
@@ -624,7 +627,7 @@ address is then restored from the cache entry. <b><br>
|
|||||||
radius</b> - authentication with RADIUS. <br>
|
radius</b> - authentication with RADIUS. <br>
|
||||||
Plugins may add additional authentication types.</p>
|
Plugins may add additional authentication types.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">It´s
|
<p style="margin-left:6%; margin-top: 1em">It´s
|
||||||
possible to use multiple authentication types in the same
|
possible to use multiple authentication types in the same
|
||||||
command. E.g. <br>
|
command. E.g. <br>
|
||||||
auth iponly strong <br>
|
auth iponly strong <br>
|
||||||
@@ -638,7 +641,7 @@ for dedicated laptops and request a username/password for
|
|||||||
shared ones.</p>
|
shared ones.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>authcache</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>authcache</b>
|
||||||
<i><cachtype> <cachtime> <cachesize></i>
|
<i><cachtype> <cachtime> <cachesize></i>
|
||||||
<br>
|
<br>
|
||||||
Cache authentication information for a given amount of time
|
Cache authentication information for a given amount of time
|
||||||
@@ -683,7 +686,7 @@ see <b>allow</b>. <br>
|
|||||||
Use auth type <b>cache</b> (or <b>cacheacl</b>) for cached
|
Use auth type <b>cache</b> (or <b>cacheacl</b>) for cached
|
||||||
authentication</p>
|
authentication</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>allow</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>allow</b>
|
||||||
<i><userlist> <sourcelist> <targetlist>
|
<i><userlist> <sourcelist> <targetlist>
|
||||||
<targetportlist> <operationlist>
|
<targetportlist> <operationlist>
|
||||||
<weekdayslist> <timeperiodslist></i> <b><br>
|
<weekdayslist> <timeperiodslist></i> <b><br>
|
||||||
@@ -719,7 +722,7 @@ specific addresses immediately without any conditions you
|
|||||||
should either bind proxy to appropriate interface only or to
|
should either bind proxy to appropriate interface only or to
|
||||||
use ip filters.</p>
|
use ip filters.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Operation is one
|
<p style="margin-left:6%; margin-top: 1em">Operation is one
|
||||||
of: <b><br>
|
of: <b><br>
|
||||||
CONNECT</b> establish outgoing TCP connection <b><br>
|
CONNECT</b> establish outgoing TCP connection <b><br>
|
||||||
BIND</b> bind TCP port for listening <b><br>
|
BIND</b> bind TCP port for listening <b><br>
|
||||||
@@ -743,7 +746,7 @@ remote side. <b><br>
|
|||||||
FTP</b> matches any FTP/FTP Data request <b><br>
|
FTP</b> matches any FTP/FTP Data request <b><br>
|
||||||
ADMIN</b> access to administration interface</p>
|
ADMIN</b> access to administration interface</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Weekdays are
|
<p style="margin-left:6%; margin-top: 1em">Weekdays are
|
||||||
week day numbers or periods, 0 or 7 means Sunday, 1 is
|
week day numbers or periods, 0 or 7 means Sunday, 1 is
|
||||||
Monday, 1-5 means Monday through Friday. <br>
|
Monday, 1-5 means Monday through Friday. <br>
|
||||||
Timeperiodlists is a list of time periods in
|
Timeperiodlists is a list of time periods in
|
||||||
@@ -788,7 +791,7 @@ RADIUS or plugin authentication: <b>cacheacl</b> with the
|
|||||||
destination in the cache key if no parent proxy is used,
|
destination in the cache key if no parent proxy is used,
|
||||||
<b>cache</b> otherwise, see <b>cacheacl</b>.</p>
|
<b>cache</b> otherwise, see <b>cacheacl</b>.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>parent</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>parent</b>
|
||||||
<i><weight> <type> <ip> <port>
|
<i><weight> <type> <ip> <port>
|
||||||
<username> <password></i> <br>
|
<username> <password></i> <br>
|
||||||
this command must follow "allow" rule. It extends
|
this command must follow "allow" rule. It extends
|
||||||
@@ -818,7 +821,7 @@ connections. Chains are only applied to new connections,
|
|||||||
pipelined (keep-alive) requests in the same connection use
|
pipelined (keep-alive) requests in the same connection use
|
||||||
the same chain.</p>
|
the same chain.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">type is one of:
|
<p style="margin-left:6%; margin-top: 1em">type is one of:
|
||||||
<b><br>
|
<b><br>
|
||||||
extip</b> does not actually redirect the request; it sets
|
extip</b> does not actually redirect the request; it sets
|
||||||
the external address for this request to <i><ip></i>.
|
the external address for this request to <i><ip></i>.
|
||||||
@@ -877,7 +880,7 @@ Requires SSL/TLS support (WITH_SSL) and is used with
|
|||||||
<b>ssl_client_mode 3</b>, which only handshakes TLS for
|
<b>ssl_client_mode 3</b>, which only handshakes TLS for
|
||||||
<b>s</b>-suffixed parents.</p>
|
<b>s</b>-suffixed parents.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">IP and port are
|
<p style="margin-left:6%; margin-top: 1em">IP and port are
|
||||||
ip addres and port of parent proxy server. If IP is zero, ip
|
ip addres and port of parent proxy server. If IP is zero, ip
|
||||||
is taken from original request, only port is changed. If
|
is taken from original request, only port is changed. If
|
||||||
port is zero, it´s taken from original request, only
|
port is zero, it´s taken from original request, only
|
||||||
@@ -898,7 +901,7 @@ unix:@parent.proxy 3128). When using Unix sockets, the port
|
|||||||
number is ignored but must be specified for syntax
|
number is ignored but must be specified for syntax
|
||||||
compatibility.</p>
|
compatibility.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Main purpose of
|
<p style="margin-left:6%; margin-top: 1em">Main purpose of
|
||||||
local redirections is to have the requested resource (URL or
|
local redirections is to have the requested resource (URL or
|
||||||
POP3 username) logged and protocol-specific filters applied.
|
POP3 username) logged and protocol-specific filters applied.
|
||||||
In case of local redirection, ACLs are reviewed twice:
|
In case of local redirection, ACLs are reviewed twice:
|
||||||
@@ -923,19 +926,19 @@ parent proxy. Username of ´*´ means username
|
|||||||
must be supplied by user.</p>
|
must be supplied by user.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>parentretries</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>parentretries</b>
|
||||||
<i><number></i> <br>
|
<i><number></i> <br>
|
||||||
Number of retries to connect to parent proxy. Default is
|
Number of retries to connect to parent proxy. Default is
|
||||||
1.</p>
|
1.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>nolog</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>nolog</b>
|
||||||
<i><n></i> <br>
|
<i><n></i> <br>
|
||||||
extends last allow or deny command to prevent logging, e.g.
|
extends last allow or deny command to prevent logging, e.g.
|
||||||
<br>
|
<br>
|
||||||
allow * * 192.168.1.1 <br>
|
allow * * 192.168.1.1 <br>
|
||||||
nolog</p>
|
nolog</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>weight</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>weight</b>
|
||||||
<i><n></i> <br>
|
<i><n></i> <br>
|
||||||
extends last allow or deny command to set weight for this
|
extends last allow or deny command to set weight for this
|
||||||
request <br>
|
request <br>
|
||||||
@@ -943,7 +946,7 @@ allow * * 192.168.1.1 <br>
|
|||||||
weight 100 <br>
|
weight 100 <br>
|
||||||
Weight may be used for different purposes.</p>
|
Weight may be used for different purposes.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>force <br>
|
<p style="margin-left:6%; margin-top: 1em"><b>force <br>
|
||||||
noforce</b> <br>
|
noforce</b> <br>
|
||||||
If force is specified for service, configuration reload will
|
If force is specified for service, configuration reload will
|
||||||
require all current sessions of this service to be
|
require all current sessions of this service to be
|
||||||
@@ -953,7 +956,7 @@ closed. noforce allows to keep previously authenticated
|
|||||||
connections.</p>
|
connections.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>bandlimin</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>bandlimin</b>
|
||||||
<i><rate> <userlist> <sourcelist>
|
<i><rate> <userlist> <sourcelist>
|
||||||
<targetlist> <targetportlist>
|
<targetlist> <targetportlist>
|
||||||
<operationlist> <weekdayslist>
|
<operationlist> <weekdayslist>
|
||||||
@@ -995,7 +998,7 @@ POP3, you can use <br>
|
|||||||
nobandlimin * * * 110 <br>
|
nobandlimin * * * 110 <br>
|
||||||
before the rest of bandlim rules.</p>
|
before the rest of bandlim rules.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>connlim</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>connlim</b>
|
||||||
<i><rate> <period> <userlist>
|
<i><rate> <period> <userlist>
|
||||||
<sourcelist> <targetlist> <targetportlist>
|
<sourcelist> <targetlist> <targetportlist>
|
||||||
<operationlist> <weekdayslist>
|
<operationlist> <weekdayslist>
|
||||||
@@ -1017,7 +1020,7 @@ required per client, a separate rule must be added for every
|
|||||||
client. Like with nobandlimin, noconnlim adds an
|
client. Like with nobandlimin, noconnlim adds an
|
||||||
exception.</p>
|
exception.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>counter</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>counter</b>
|
||||||
<i><filename> <reporttype>
|
<i><filename> <reporttype>
|
||||||
<reportname></i> <b><br>
|
<reportname></i> <b><br>
|
||||||
countin</b> <i><number> <type> <limit>
|
countin</b> <i><number> <type> <limit>
|
||||||
@@ -1045,7 +1048,7 @@ nocountall</b> <i><userlist> <sourcelist>
|
|||||||
<operationlist> <weekdayslist>
|
<operationlist> <weekdayslist>
|
||||||
<timeperiodslist></i></p>
|
<timeperiodslist></i></p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">counter,
|
<p style="margin-left:6%; margin-top: 1em">counter,
|
||||||
countin, nocountin, countout, nocountout, countall,
|
countin, nocountin, countout, nocountout, countall,
|
||||||
nocountall commands are used to set a traffic limit in MB
|
nocountall commands are used to set a traffic limit in MB
|
||||||
for a period of time (day, week or month). Filename is a
|
for a period of time (day, week or month). Filename is a
|
||||||
@@ -1070,7 +1073,7 @@ report is a text file with counter values in the format:
|
|||||||
The rest of parameters is identical to
|
The rest of parameters is identical to
|
||||||
<b>bandlim</b>/<b>nobandlim</b>.</p>
|
<b>bandlim</b>/<b>nobandlim</b>.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>users</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>users</b>
|
||||||
<i>username</i>[:<i>pwtype</i>:<i>password</i>] ... <br>
|
<i>username</i>[:<i>pwtype</i>:<i>password</i>] ... <br>
|
||||||
pwtype is one of: <br>
|
pwtype is one of: <br>
|
||||||
none (empty) - use system authentication <b><br>
|
none (empty) - use system authentication <b><br>
|
||||||
@@ -1088,7 +1091,7 @@ users "test4:CR:$3$salt$G47yV9w...." <br>
|
|||||||
Note: double quotes are required because the password
|
Note: double quotes are required because the password
|
||||||
contains a $ sign.</p>
|
contains a $ sign.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>flush</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>flush</b>
|
||||||
<br>
|
<br>
|
||||||
empty the active access list. The access list must be
|
empty the active access list. The access list must be
|
||||||
flushed every time you create a new access list for a new
|
flushed every time you create a new access list for a new
|
||||||
@@ -1100,43 +1103,51 @@ allow * 192.168.1.0/24 <br>
|
|||||||
socks <br>
|
socks <br>
|
||||||
sets different ACLs for <b>pop3p</b> and <b>socks</b></p>
|
sets different ACLs for <b>pop3p</b> and <b>socks</b></p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>system</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>system</b>
|
||||||
<i><command></i> <br>
|
<i><command></i> <br>
|
||||||
execute system command</p>
|
execute system command</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>pidfile</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>pidfile</b>
|
||||||
<i><filename></i> <br>
|
<i><filename></i> <br>
|
||||||
write pid of current process to file. It can be used to
|
write pid of current process to file. It can be used to
|
||||||
manipulate 3proxy with signals under Unix. Currently next
|
manipulate 3proxy with signals under Unix. Currently next
|
||||||
signals are available:</p>
|
signals are available:</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>monitor</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>monitor</b>
|
||||||
<i><filename></i> <br>
|
<i><filename></i> <br>
|
||||||
If file monitored changes in modification time or size,
|
If file monitored changes in modification time or size,
|
||||||
3proxy reloads configuration within one minute. Any number
|
3proxy reloads configuration within one minute. Any number
|
||||||
of files may be monitored.</p>
|
of files may be monitored.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>setuid</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>setuid</b>
|
||||||
<i><uid></i> <br>
|
<i><uid></i> <br>
|
||||||
calls setuid(uid), uid can be numeric or since 0.9 username.
|
calls setuid(uid), uid can be numeric or since 0.9 username.
|
||||||
Unix only. Warning: under some Linux kernels setuid() works
|
Unix only. Warning: under some Linux kernels setuid() works
|
||||||
for current thread only. It makes it impossible to suid for
|
for current thread only. It makes it impossible to suid for
|
||||||
all threads.</p>
|
all threads.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>setgid</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>setgid</b>
|
||||||
<i><gid></i> <br>
|
<i><gid></i> <br>
|
||||||
calls setgid(gid), gid can be numeric or since 0.9
|
calls setgid(gid), gid can be numeric or since 0.9
|
||||||
groupname. Unix only.</p>
|
groupname. Unix only.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>chroot</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>chroot</b>
|
||||||
<i><path></i> [<i><uid></i>]
|
<i><path></i> [<i><uid></i>]
|
||||||
[<i><gid></i>] <br>
|
[<i><gid></i>] <br>
|
||||||
calls chroot(path) and sets gid/uid. Unix only. uid/gid
|
calls chroot(path) and sets gid/uid. Unix only. uid/gid
|
||||||
supported since 0.9, can be numeric or
|
supported since 0.9, can be numeric or
|
||||||
username/groupname</p>
|
username/groupname. The time zone and the syslog connection
|
||||||
|
are set up before the call.
|
||||||
|
Plugins which read their own configuration or load modules
|
||||||
|
while running need them inside the chroot: PAM
|
||||||
|
(<i>/etc/pam.d</i> and the modules it names, read for every
|
||||||
|
authentication), LDAP (<i>ldap.conf</i> and, for ldaps, the
|
||||||
|
CA certificates), ODBC (<i>odbc.ini</i>, <i>odbcinst.ini</i>
|
||||||
|
and the driver libraries, loaded again whenever the
|
||||||
|
connection is reopened).</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>stacksize</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>stacksize</b>
|
||||||
<i><value_to_add_to_default_stack_size></i> <br>
|
<i><value_to_add_to_default_stack_size></i> <br>
|
||||||
Change the default size for thread stacks. May be required
|
Change the default size for thread stacks. May be required
|
||||||
in some situations, e.g. with non-default plugins, or on
|
in some situations, e.g. with non-default plugins, or on
|
||||||
@@ -1165,7 +1176,7 @@ disable the thread stack.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>plugin</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>plugin</b>
|
||||||
<i><path_to_shared_library>
|
<i><path_to_shared_library>
|
||||||
<function_to_call></i> [<i><arg1></i> ...] <br>
|
<function_to_call></i> [<i><arg1></i> ...] <br>
|
||||||
Loads specified library and calls given export function with
|
Loads specified library and calls given export function with
|
||||||
@@ -1176,7 +1187,7 @@ function_to_call must return 0 in case of success, value
|
|||||||
> 0 to indicate error.</p>
|
> 0 to indicate error.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>filtermaxsize</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>filtermaxsize</b>
|
||||||
<i><max_size_of_data_to_filter></i> <br>
|
<i><max_size_of_data_to_filter></i> <br>
|
||||||
If Content-length (or another data length) is greater than
|
If Content-length (or another data length) is greater than
|
||||||
the given value, no data filtering will be performed through
|
the given value, no data filtering will be performed through
|
||||||
@@ -1188,13 +1199,13 @@ Content-Length changing. Default is 1MB (1048576).</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">SSL/TLS support
|
<p style="margin-left:6%; margin-top: 1em">SSL/TLS support
|
||||||
is built into 3proxy (since 0.9.7) when compiled with
|
is built into 3proxy (since 0.9.7) when compiled with
|
||||||
OpenSSL (WITH_SSL). Previously available as SSLPlugin, the
|
OpenSSL (WITH_SSL). Previously available as SSLPlugin, the
|
||||||
functionality is now integrated into the main binary. The
|
functionality is now integrated into the main binary. The
|
||||||
plugin line is no longer required.</p>
|
plugin line is no longer required.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">SSL/TLS can be
|
<p style="margin-left:6%; margin-top: 1em">SSL/TLS can be
|
||||||
used for: - transparent MITM (Man-in-the-Middle) for TLS
|
used for: - transparent MITM (Man-in-the-Middle) for TLS
|
||||||
traffic inspection - https:// proxy (TLS-encrypted
|
traffic inspection - https:// proxy (TLS-encrypted
|
||||||
connection between client and proxy) - TLS client
|
connection between client and proxy) - TLS client
|
||||||
@@ -1207,7 +1218,7 @@ certificates</p>
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ssl_mitm</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>ssl_mitm</b>
|
||||||
- spoof certificates for services started below. Usage
|
- spoof certificates for services started below. Usage
|
||||||
without ssl_client_verify is insecure. <b><br>
|
without ssl_client_verify is insecure. <b><br>
|
||||||
ssl_nomitm</b> - do not spoof certificates for services
|
ssl_nomitm</b> - do not spoof certificates for services
|
||||||
@@ -1218,7 +1229,7 @@ started below</p>
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ssl_serv</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>ssl_serv</b>
|
||||||
(or ssl_server) - require TLS connection from clients for
|
(or ssl_server) - require TLS connection from clients for
|
||||||
services below <b><br>
|
services below <b><br>
|
||||||
ssl_noserv</b> (or ssl_noserver) - do not require TLS
|
ssl_noserv</b> (or ssl_noserver) - do not require TLS
|
||||||
@@ -1229,7 +1240,7 @@ connection from clients for services below</p>
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ssl_cli</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>ssl_cli</b>
|
||||||
(or ssl_client) - establish TLS connection to upstream
|
(or ssl_client) - establish TLS connection to upstream
|
||||||
server for services below <b><br>
|
server for services below <b><br>
|
||||||
ssl_nocli</b> (or ssl_noclient) - do not establish TLS
|
ssl_nocli</b> (or ssl_noclient) - do not establish TLS
|
||||||
@@ -1241,7 +1252,7 @@ connection to upstream server for services below</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ssl_server_cert</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>ssl_server_cert</b>
|
||||||
<i>/path/to/cert</i> - Server certificate (should not be
|
<i>/path/to/cert</i> - Server certificate (should not be
|
||||||
self-signed, must contain SAN) for ssl_serv <b><br>
|
self-signed, must contain SAN) for ssl_serv <b><br>
|
||||||
ssl_server_key</b> <i>/path/to/key</i> - Server certificate
|
ssl_server_key</b> <i>/path/to/key</i> - Server certificate
|
||||||
@@ -1306,14 +1317,14 @@ generated MITM certificates cache</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">PCRE (Perl
|
<p style="margin-left:6%; margin-top: 1em">PCRE (Perl
|
||||||
Compatible Regular Expressions) filtering is built into
|
Compatible Regular Expressions) filtering is built into
|
||||||
3proxy (since 0.9.7) when compiled with PCRE2 support
|
3proxy (since 0.9.7) when compiled with PCRE2 support
|
||||||
(WITH_PCRE). Previously available as PCREPlugin, the
|
(WITH_PCRE). Previously available as PCREPlugin, the
|
||||||
functionality is now integrated into the main binary. The
|
functionality is now integrated into the main binary. The
|
||||||
plugin line is no longer required.</p>
|
plugin line is no longer required.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">PCRE filtering
|
<p style="margin-left:6%; margin-top: 1em">PCRE filtering
|
||||||
allows creating matching and replacement rules with regular
|
allows creating matching and replacement rules with regular
|
||||||
expressions for client requests, headers, and data.</p>
|
expressions for client requests, headers, and data.</p>
|
||||||
|
|
||||||
@@ -1322,7 +1333,7 @@ expressions for client requests, headers, and data.</p>
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>pcre</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>pcre</b>
|
||||||
<i>TYPE FILTER_ACTION REGEXP [ACE]</i> <br>
|
<i>TYPE FILTER_ACTION REGEXP [ACE]</i> <br>
|
||||||
Apply a rule for matching regular expression. <b><br>
|
Apply a rule for matching regular expression. <b><br>
|
||||||
pcre_rewrite</b> <i>TYPE FILTER_ACTION REGEXP
|
pcre_rewrite</b> <i>TYPE FILTER_ACTION REGEXP
|
||||||
@@ -1358,7 +1369,7 @@ PCRE_BSR_UNICODE.</p>
|
|||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">TYPE - type of
|
<p style="margin-left:6%; margin-top: 1em">TYPE - type of
|
||||||
filtered data (comma-delimited list): <br>
|
filtered data (comma-delimited list): <br>
|
||||||
request - content of the client’s request (e.g., HTTP
|
request - content of the client’s request (e.g., HTTP
|
||||||
GET request string) <br>
|
GET request string) <br>
|
||||||
@@ -1369,7 +1380,7 @@ data) <br>
|
|||||||
srvdata - data received from the server (e.g., HTML
|
srvdata - data received from the server (e.g., HTML
|
||||||
page)</p>
|
page)</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">FILTER_ACTION -
|
<p style="margin-left:6%; margin-top: 1em">FILTER_ACTION -
|
||||||
action on match: <br>
|
action on match: <br>
|
||||||
allow - allow this request without checking the rest of the
|
allow - allow this request without checking the rest of the
|
||||||
rules <br>
|
rules <br>
|
||||||
@@ -1378,18 +1389,18 @@ rules <br>
|
|||||||
dunno - continue with the rest of the rules (useful with
|
dunno - continue with the rest of the rules (useful with
|
||||||
pcre_rewrite)</p>
|
pcre_rewrite)</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">REGEXP - PCRE
|
<p style="margin-left:6%; margin-top: 1em">REGEXP - PCRE
|
||||||
(Perl) regular expression. Use * if no regexp matching is
|
(Perl) regular expression. Use * if no regexp matching is
|
||||||
required.</p>
|
required.</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">REWRITE_EXPRESSION
|
<p style="margin-left:6%; margin-top: 1em">REWRITE_EXPRESSION
|
||||||
- substitution string. May contain Perl-style substrings $1,
|
- substitution string. May contain Perl-style substrings $1,
|
||||||
$2, etc. $0 means the whole matched string. \r and \n may be
|
$2, etc. $0 means the whole matched string. \r and \n may be
|
||||||
used to insert new lines; the string may be empty
|
used to insert new lines; the string may be empty
|
||||||
("").</p>
|
("").</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">ACE - access
|
<p style="margin-left:6%; margin-top: 1em">ACE - access
|
||||||
control entry (user names, source IPs, destination IPs,
|
control entry (user names, source IPs, destination IPs,
|
||||||
ports, etc.), identical to allow/deny/bandlimin commands.
|
ports, etc.), identical to allow/deny/bandlimin commands.
|
||||||
The regular expression is only matched if the ACL matches
|
The regular expression is only matched if the ACL matches
|
||||||
@@ -1402,7 +1413,7 @@ authentication and/or allow/deny ACLs.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -1410,7 +1421,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
3proxy_crypt(8), proxy(8), ftppr(8), socks(8), pop3p(8),
|
3proxy_crypt(8), proxy(8), ftppr(8), socks(8), pop3p(8),
|
||||||
imapp(8), smtpp(8), tlspr(8), tcppm(8), udppm(8),
|
imapp(8), smtpp(8), tlspr(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
@@ -1421,7 +1432,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+28
-28
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy</b> -
|
||||||
3[APA3A] tiny proxy server, or trivial proxy server, or free
|
3[APA3A] tiny proxy server, or trivial proxy server, or free
|
||||||
proxy server</p>
|
proxy server</p>
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ proxy server</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy</b>
|
||||||
[<i>config_file</i>] <b><br>
|
[<i>config_file</i>] <b><br>
|
||||||
3proxy</b> [<i>--install</i>] <b><br>
|
3proxy</b> [<i>--install</i>] <b><br>
|
||||||
3proxy</b> [<i>--remove</i>]</p>
|
3proxy</b> [<i>--remove</i>]</p>
|
||||||
@@ -44,7 +44,7 @@ proxy server</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy</b> is
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy</b> is
|
||||||
a universal proxy server. It can be used to provide internal
|
a universal proxy server. It can be used to provide internal
|
||||||
users with fully controllable access to external resources
|
users with fully controllable access to external resources
|
||||||
or to provide external users with access to internal
|
or to provide external users with access to internal
|
||||||
@@ -71,7 +71,7 @@ under Unix). So you can play your favourite games, listen to
|
|||||||
music, exchange files and messages and even accept incoming
|
music, exchange files and messages and even accept incoming
|
||||||
connections behind a proxy server.</p>
|
connections behind a proxy server.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i>dnspr</i>
|
<p style="margin-left:6%; margin-top: 1em"><i>dnspr</i>
|
||||||
does not exist as an independent service. It’s a DNS
|
does not exist as an independent service. It’s a DNS
|
||||||
caching proxy (it requires <i>nscache</i> and <i>nserver</i>
|
caching proxy (it requires <i>nscache</i> and <i>nserver</i>
|
||||||
to be set in the configuration. Only A-records are cached.
|
to be set in the configuration. Only A-records are cached.
|
||||||
@@ -79,7 +79,7 @@ Please note that this caching is mostly a ’hack’
|
|||||||
and has nothing to do with a real DNS server, but it works
|
and has nothing to do with a real DNS server, but it works
|
||||||
perfectly for SOHO networks.</p>
|
perfectly for SOHO networks.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy supports
|
<p style="margin-left:6%; margin-top: 1em">3proxy supports
|
||||||
access control lists (ACL) like network router. Source and
|
access control lists (ACL) like network router. Source and
|
||||||
destination networks and destination port can be specified.
|
destination networks and destination port can be specified.
|
||||||
In addition, usernames and gateway action (for example GET
|
In addition, usernames and gateway action (for example GET
|
||||||
@@ -92,7 +92,7 @@ ACL action request can be allowed, denied or redirected to
|
|||||||
another host or to another proxy server or even to a chain
|
another host or to another proxy server or even to a chain
|
||||||
of proxy servers.</p>
|
of proxy servers.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">It supports
|
<p style="margin-left:6%; margin-top: 1em">It supports
|
||||||
different types of logging: to logfiles, <b>syslog</b>(3)
|
different types of logging: to logfiles, <b>syslog</b>(3)
|
||||||
(only under Unix) or to an ODBC database. Logging format is
|
(only under Unix) or to an ODBC database. Logging format is
|
||||||
tunable to provide compatibility with existing log file
|
tunable to provide compatibility with existing log file
|
||||||
@@ -105,9 +105,9 @@ Apache or Squid log parsers.</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>config_file</b></p>
|
<p style="margin-left:6%; margin-top: 1em"><b>config_file</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">Name of config file. See
|
<p style="margin-left:15%;">Name of config file. See
|
||||||
<b>3proxy.cfg</b>(3) for configuration file format. Under
|
<b>3proxy.cfg</b>(3) for configuration file format. Under
|
||||||
Windows, if config_file is not specified, <b>3proxy</b>
|
Windows, if config_file is not specified, <b>3proxy</b>
|
||||||
looks for a file named <i>3proxy.cfg</i> in the default
|
looks for a file named <i>3proxy.cfg</i> in the default
|
||||||
@@ -119,14 +119,14 @@ script just by setting +x mode and adding <br>
|
|||||||
#!/usr/local/3proxy/3proxy <br>
|
#!/usr/local/3proxy/3proxy <br>
|
||||||
as a first line in 3proxy.cfg</p>
|
as a first line in 3proxy.cfg</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>--install</b></p>
|
<p style="margin-left:6%;"><b>--install</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Windows NT family only)
|
<p style="margin-left:15%;">(Windows NT family only)
|
||||||
install <b>3proxy</b> as a system service</p>
|
install <b>3proxy</b> as a system service</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>--remove</b></p>
|
<p style="margin-left:6%;"><b>--remove</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Windows NT family only) remove
|
<p style="margin-left:15%;">(Windows NT family only) remove
|
||||||
<b>3proxy</b> from system services</p>
|
<b>3proxy</b> from system services</p>
|
||||||
|
|
||||||
<h2>SIGNALS
|
<h2>SIGNALS
|
||||||
@@ -134,29 +134,29 @@ install <b>3proxy</b> as a system service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Under Unix there
|
<p style="margin-left:6%; margin-top: 1em">Under Unix there
|
||||||
are a few signals <b>3proxy</b> catches. See <b>kill</b>(1).
|
are a few signals <b>3proxy</b> catches. See <b>kill</b>(1).
|
||||||
<b><br>
|
<b><br>
|
||||||
SIGTERM</b></p>
|
SIGTERM</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">clean up connections and
|
<p style="margin-left:15%;">clean up connections and
|
||||||
exit</p>
|
exit</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>SIGPAUSE</b></p>
|
<p style="margin-left:6%;"><b>SIGPAUSE</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">stop accepting new connections,
|
<p style="margin-left:15%;">stop accepting new connections,
|
||||||
on second signal - start and re-read configuration</p>
|
on second signal - start and re-read configuration</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>SIGCONT</b></p>
|
<p style="margin-left:6%;"><b>SIGCONT</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">start to accept new
|
<p style="margin-left:15%;">start to accept new
|
||||||
connections</p>
|
connections</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>SIGUSR1</b></p>
|
<p style="margin-left:6%;"><b>SIGUSR1</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">reload configuration</p>
|
<p style="margin-left:15%;">reload configuration</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Under Windows,
|
<p style="margin-left:6%; margin-top: 1em">Under Windows,
|
||||||
if <b>3proxy</b> is installed as a service you can use
|
if <b>3proxy</b> is installed as a service you can use
|
||||||
standard service management to start, stop, pause and
|
standard service management to start, stop, pause and
|
||||||
continue the 3proxy service, for example: <b><br>
|
continue the 3proxy service, for example: <b><br>
|
||||||
@@ -165,7 +165,7 @@ net stop 3proxy <br>
|
|||||||
net pause 3proxy <br>
|
net pause 3proxy <br>
|
||||||
net continue 3proxy</b></p>
|
net continue 3proxy</b></p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Web admin
|
<p style="margin-left:6%; margin-top: 1em">Web admin
|
||||||
service can also be used to reload configuration. Use wget
|
service can also be used to reload configuration. Use wget
|
||||||
to automate this task.</p>
|
to automate this task.</p>
|
||||||
|
|
||||||
@@ -175,10 +175,10 @@ to automate this task.</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i>/usr/local/3proxy/3proxy.cfg
|
<p style="margin-left:6%; margin-top: 1em"><i>/usr/local/3proxy/3proxy.cfg
|
||||||
(3proxy.cfg)</i></p>
|
(3proxy.cfg)</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;"><b>3proxy</b> configuration
|
<p style="margin-left:15%;"><b>3proxy</b> configuration
|
||||||
file</p>
|
file</p>
|
||||||
|
|
||||||
<h2>BUGS
|
<h2>BUGS
|
||||||
@@ -186,7 +186,7 @@ file</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -194,7 +194,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy.cfg(5),
|
<p style="margin-left:6%; margin-top: 1em">3proxy.cfg(5),
|
||||||
proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8),
|
proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8),
|
||||||
udppm(8), kill(1), syslogd(8), <br>
|
udppm(8), kill(1), syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -204,7 +204,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy_crypt</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy_crypt</b>
|
||||||
- utility to generate encrypted passwords for 3proxy</p>
|
- utility to generate encrypted passwords for 3proxy</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>3proxy_crypt</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy_crypt</b>
|
||||||
<i>password</i> <b><br>
|
<i>password</i> <b><br>
|
||||||
3proxy_crypt</b> <i>salt password</i></p>
|
3proxy_crypt</b> <i>salt password</i></p>
|
||||||
|
|
||||||
@@ -45,23 +45,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>3proxy_crypt</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>3proxy_crypt</b></i>
|
||||||
is a utility to generate encrypted password hashes for use
|
is a utility to generate encrypted password hashes for use
|
||||||
with 3proxy configuration. Encrypted passwords allow the
|
with 3proxy configuration. Encrypted passwords allow the
|
||||||
system to avoid storing passwords in cleartext in
|
system to avoid storing passwords in cleartext in
|
||||||
configuration files.</p>
|
configuration files.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">When invoked
|
<p style="margin-left:6%; margin-top: 1em">When invoked
|
||||||
with a single argument, it produces an NT password hash
|
with a single argument, it produces an NT password hash
|
||||||
(MD4-based, suitable for NTLM authentication). The output is
|
(MD4-based, suitable for NTLM authentication). The output is
|
||||||
prefixed with <b>NT:</b>.</p>
|
prefixed with <b>NT:</b>.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">When invoked
|
<p style="margin-left:6%; margin-top: 1em">When invoked
|
||||||
with two arguments (salt and password), it produces a
|
with two arguments (salt and password), it produces a
|
||||||
BLAKE2b password hash. The salt length is limited to 64
|
BLAKE2b password hash. The salt length is limited to 64
|
||||||
characters. The output is prefixed with <b>CR:</b>.</p>
|
characters. The output is prefixed with <b>CR:</b>.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">The resulting
|
<p style="margin-left:6%; margin-top: 1em">The resulting
|
||||||
hash can be used in the 3proxy configuration file with the
|
hash can be used in the 3proxy configuration file with the
|
||||||
<b>users</b> directive instead of a cleartext password.</p>
|
<b>users</b> directive instead of a cleartext password.</p>
|
||||||
|
|
||||||
@@ -71,25 +71,25 @@ hash can be used in the 3proxy configuration file with the
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i>password</i></p>
|
<p style="margin-left:6%; margin-top: 1em"><i>password</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">Cleartext password to
|
<p style="margin-left:15%;">Cleartext password to
|
||||||
encrypt.</p>
|
encrypt.</p>
|
||||||
|
|
||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="5%">
|
<td width="5%">
|
||||||
|
|
||||||
|
|
||||||
<p><i>salt</i></p></td>
|
<p><i>salt</i></p></td>
|
||||||
<td width="4%"></td>
|
<td width="4%"></td>
|
||||||
<td width="67%">
|
<td width="65%">
|
||||||
|
|
||||||
|
|
||||||
<p>Salt string for BLAKE2b hashing (max 64 characters).</p></td>
|
<p>Salt string for BLAKE2b hashing (max 64 characters).</p></td>
|
||||||
<td width="15%">
|
<td width="20%">
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -98,30 +98,30 @@ encrypt.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Generate NT
|
<p style="margin-left:6%; margin-top: 1em">Generate NT
|
||||||
password hash:</p>
|
password hash:</p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">3proxy_crypt
|
<p style="margin-left:15%;">3proxy_crypt
|
||||||
MySecretPassword</p>
|
MySecretPassword</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;">Result:</p>
|
<p style="margin-left:6%;">Result:</p>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:18%;">NT:3F7E6D8D96E8E7A9B0C1D2E3F4A5B6C7</p>
|
<p style="margin-left:15%;">NT:3F7E6D8D96E8E7A9B0C1D2E3F4A5B6C7</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;">Generate BLAKE2b password hash
|
<p style="margin-left:6%;">Generate BLAKE2b password hash
|
||||||
with salt:</p>
|
with salt:</p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">3proxy_crypt MySalt
|
<p style="margin-left:15%;">3proxy_crypt MySalt
|
||||||
MySecretPassword</p>
|
MySecretPassword</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;">Result:</p>
|
<p style="margin-left:6%;">Result:</p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">CR:$3$MySalt$...</p>
|
<p style="margin-left:15%;">CR:$3$MySalt$...</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;">Using in 3proxy.cfg:</p>
|
<p style="margin-left:6%;">Using in 3proxy.cfg:</p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">users
|
<p style="margin-left:15%;">users
|
||||||
user1:CR:$3$MySalt$...</p>
|
user1:CR:$3$MySalt$...</p>
|
||||||
|
|
||||||
<h2>NOTES
|
<h2>NOTES
|
||||||
@@ -129,11 +129,11 @@ user1:CR:$3$MySalt$...</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">The NT hash uses
|
<p style="margin-left:6%; margin-top: 1em">The NT hash uses
|
||||||
the RSA MD4 Message-Digest Algorithm. The BLAKE2b hash uses
|
the RSA MD4 Message-Digest Algorithm. The BLAKE2b hash uses
|
||||||
the BLAKE2 cryptographic hash function.</p>
|
the BLAKE2 cryptographic hash function.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">When a password
|
<p style="margin-left:6%; margin-top: 1em">When a password
|
||||||
hash is prefixed with <b>NT:</b> or <b>CR:</b>, 3proxy uses
|
hash is prefixed with <b>NT:</b> or <b>CR:</b>, 3proxy uses
|
||||||
the corresponding algorithm to verify passwords instead of
|
the corresponding algorithm to verify passwords instead of
|
||||||
comparing cleartext strings.</p>
|
comparing cleartext strings.</p>
|
||||||
@@ -143,7 +143,7 @@ comparing cleartext strings.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -151,7 +151,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
3proxy.cfg(5), <br>
|
3proxy.cfg(5), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+61
-59
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ftppr</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>ftppr</b> -
|
||||||
FTP proxy gateway service</p>
|
FTP proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ FTP proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ftppr</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>ftppr</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]
|
[<b>-e</b><i>external_ip</i>]
|
||||||
@@ -43,7 +43,7 @@ FTP proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>ftppr</b> is
|
<p style="margin-left:6%; margin-top: 1em"><b>ftppr</b> is
|
||||||
FTP gateway service to allow internal users to access
|
FTP gateway service to allow internal users to access
|
||||||
external FTP servers.</p>
|
external FTP servers.</p>
|
||||||
|
|
||||||
@@ -55,80 +55,81 @@ external FTP servers.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never look for username authentication.</p></td></tr>
|
<p style="margin-top: 1em">Never look for username
|
||||||
|
authentication.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -139,13 +140,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -155,55 +156,56 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/ftppr.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/ftppr.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-h</b></p></td>
|
<p style="margin-top: 1em"><b>-h</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Default destination. It’s used if the target
|
<p style="margin-top: 1em">Default destination. It’s
|
||||||
address is not specified by the user.</p></td></tr>
|
used if the target address is not specified by the user.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 21.</p></td></tr>
|
incoming connections. Default is 21.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -211,7 +213,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You can use any
|
<p style="margin-left:6%; margin-top: 1em">You can use any
|
||||||
FTP client, regardless of FTP proxy support. For a client
|
FTP client, regardless of FTP proxy support. For a client
|
||||||
with FTP proxy support, configure <i>internal_ip</i> and
|
with FTP proxy support, configure <i>internal_ip</i> and
|
||||||
<i>port</i> in the FTP proxy parameters. For clients without
|
<i>port</i> in the FTP proxy parameters. For clients without
|
||||||
@@ -230,7 +232,7 @@ supported.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -238,7 +240,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
proxy(8), pop3p(8), socks(8), tcppm(8), udppm(8),
|
proxy(8), pop3p(8), socks(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -248,7 +250,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+67
-65
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>imapp</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>imapp</b> -
|
||||||
IMAPv4 proxy gateway service</p>
|
IMAPv4 proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ IMAPv4 proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>imapp</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>imapp</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]
|
[<b>-e</b><i>external_ip</i>]
|
||||||
@@ -44,7 +44,7 @@ IMAPv4 proxy gateway service</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>imapp</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>imapp</b></i>
|
||||||
is IMAPv4 (IMAP4rev1) gateway service to allow internal
|
is IMAPv4 (IMAP4rev1) gateway service to allow internal
|
||||||
users to access external IMAP servers.</p>
|
users to access external IMAP servers.</p>
|
||||||
|
|
||||||
@@ -56,80 +56,81 @@ users to access external IMAP servers.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never look for username authentication.</p></td></tr>
|
<p style="margin-top: 1em">Never look for username
|
||||||
|
authentication.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -140,13 +141,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -156,68 +157,69 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/imapp.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/imapp.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 143.</p></td></tr>
|
incoming connections. Default is 143.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-h</b></p></td>
|
<p style="margin-top: 1em"><b>-h</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Default destination. It’s used if the target
|
<p style="margin-top: 1em">Default destination. It’s
|
||||||
address is not specified by the user.</p></td></tr>
|
used if the target address is not specified by the user.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-x</b></p></td>
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Disable STARTTLS support. STARTTLS is not announced in
|
<p style="margin-top: 1em">Disable STARTTLS support.
|
||||||
the CAPABILITY response and the STARTTLS command is not
|
STARTTLS is not announced in the CAPABILITY response and the
|
||||||
accepted.</p> </td></tr>
|
STARTTLS command is not accepted.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -225,7 +227,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You can use any
|
<p style="margin-left:6%; margin-top: 1em">You can use any
|
||||||
MUA (Mail User Agent) with IMAPv4 support. Set the client to
|
MUA (Mail User Agent) with IMAPv4 support. Set the client to
|
||||||
use <i>internal_ip</i> and <i>port</i> as an IMAP server.
|
use <i>internal_ip</i> and <i>port</i> as an IMAP server.
|
||||||
The address of the real IMAP server must be configured as a
|
The address of the real IMAP server must be configured as a
|
||||||
@@ -260,7 +262,7 @@ fails.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -268,7 +270,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
ftppr(8), pop3p(8), proxy(8), smtpp(8), socks(8), tcppm(8),
|
ftppr(8), pop3p(8), proxy(8), smtpp(8), socks(8), tcppm(8),
|
||||||
tlspr(8), udppm(8), syslogd(8), <br>
|
tlspr(8), udppm(8), syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -278,7 +280,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+67
-65
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>pop3p</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>pop3p</b> -
|
||||||
POP3 proxy gateway service</p>
|
POP3 proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ POP3 proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>pop3p</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>pop3p</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]
|
[<b>-e</b><i>external_ip</i>]
|
||||||
@@ -44,7 +44,7 @@ POP3 proxy gateway service</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>pop3p</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>pop3p</b></i>
|
||||||
is POP3 gateway service to allow internal users to access
|
is POP3 gateway service to allow internal users to access
|
||||||
external POP3 servers.</p>
|
external POP3 servers.</p>
|
||||||
|
|
||||||
@@ -56,80 +56,81 @@ external POP3 servers.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never look for username authentication.</p></td></tr>
|
<p style="margin-top: 1em">Never look for username
|
||||||
|
authentication.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -140,13 +141,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -156,68 +157,69 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/pop3p.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/pop3p.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 110.</p></td></tr>
|
incoming connections. Default is 110.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-h</b></p></td>
|
<p style="margin-top: 1em"><b>-h</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Default destination. It’s used if the target
|
<p style="margin-top: 1em">Default destination. It’s
|
||||||
address is not specified by the user.</p></td></tr>
|
used if the target address is not specified by the user.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-x</b></p></td>
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Disable STARTTLS (STLS) support. STLS is not announced
|
<p style="margin-top: 1em">Disable STARTTLS (STLS) support.
|
||||||
in the CAPA response and the STLS command is not
|
STLS is not announced in the CAPA response and the STLS
|
||||||
accepted.</p> </td></tr>
|
command is not accepted.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -225,7 +227,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You can use any
|
<p style="margin-left:6%; margin-top: 1em">You can use any
|
||||||
MUA (Mail User Agent) with POP3 support. Set the client to
|
MUA (Mail User Agent) with POP3 support. Set the client to
|
||||||
use <i>internal_ip</i> and <i>port</i> as a POP3 server. The
|
use <i>internal_ip</i> and <i>port</i> as a POP3 server. The
|
||||||
address of the real POP3 server must be configured as a part
|
address of the real POP3 server must be configured as a part
|
||||||
@@ -253,7 +255,7 @@ TLS handshake with the client fails.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -261,7 +263,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
|
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -271,7 +273,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+66
-62
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>proxy</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>proxy</b> -
|
||||||
HTTP proxy gateway service</p>
|
HTTP proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ HTTP proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>proxy</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>proxy</b>
|
||||||
[<b>-d</b>][<b>-a</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>][<b>-a</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]</p>
|
[<b>-e</b><i>external_ip</i>]</p>
|
||||||
@@ -42,7 +42,7 @@ HTTP proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>proxy</b> is
|
<p style="margin-left:6%; margin-top: 1em"><b>proxy</b> is
|
||||||
HTTP gateway service with HTTPS and FTP over HTTPS
|
HTTP gateway service with HTTPS and FTP over HTTPS
|
||||||
support.</p>
|
support.</p>
|
||||||
|
|
||||||
@@ -54,80 +54,81 @@ support.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never ask for username authentication</p></td></tr>
|
<p style="margin-top: 1em">Never ask for username
|
||||||
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -138,13 +139,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -154,65 +155,68 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/proxy.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/proxy.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-a</b></p></td>
|
<p style="margin-top: 1em"><b>-a</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Anonymous. Hide information about client.</p></td></tr>
|
<p style="margin-top: 1em">Anonymous. Hide information
|
||||||
|
about client.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-a1</b></p></td>
|
<p style="margin-top: 1em"><b>-a1</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Anonymous. Show fake information about client.</p></td></tr>
|
<p style="margin-top: 1em">Anonymous. Show fake information
|
||||||
|
about client.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 3128.</p></td></tr>
|
incoming connections. Default is 3128.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ preceeds <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ preceeds
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -220,7 +224,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You should use a
|
<p style="margin-left:6%; margin-top: 1em">You should use a
|
||||||
client with HTTP proxy support or configure a router to
|
client with HTTP proxy support or configure a router to
|
||||||
redirect HTTP traffic to the proxy (transparent proxy).
|
redirect HTTP traffic to the proxy (transparent proxy).
|
||||||
Configure the client to connect to <i>internal_ip</i> and
|
Configure the client to connect to <i>internal_ip</i> and
|
||||||
@@ -233,7 +237,7 @@ TCP-based protocol. If you need to limit clients, use
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -241,7 +245,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
|
ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -251,7 +255,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+67
-65
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>smtpp</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>smtpp</b> -
|
||||||
SMTP proxy gateway service</p>
|
SMTP proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ SMTP proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>smtpp</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>smtpp</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]
|
[<b>-e</b><i>external_ip</i>]
|
||||||
@@ -44,7 +44,7 @@ SMTP proxy gateway service</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>smtpp</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>smtpp</b></i>
|
||||||
is SMTP gateway service to allow internal users to access
|
is SMTP gateway service to allow internal users to access
|
||||||
external SMTP servers.</p>
|
external SMTP servers.</p>
|
||||||
|
|
||||||
@@ -56,80 +56,81 @@ external SMTP servers.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never look for username authentication.</p></td></tr>
|
<p style="margin-top: 1em">Never look for username
|
||||||
|
authentication.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -140,13 +141,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -156,68 +157,69 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/smtpp.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/smtpp.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 587.</p></td></tr>
|
incoming connections. Default is 587.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-h</b></p></td>
|
<p style="margin-top: 1em"><b>-h</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Default destination. It’s used if the target
|
<p style="margin-top: 1em">Default destination. It’s
|
||||||
address is not specified by the user.</p></td></tr>
|
used if the target address is not specified by the user.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-x</b></p></td>
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Disable STARTTLS support. STARTTLS is not announced in
|
<p style="margin-top: 1em">Disable STARTTLS support.
|
||||||
the EHLO response and the STARTTLS command is not
|
STARTTLS is not announced in the EHLO response and the
|
||||||
accepted.</p> </td></tr>
|
STARTTLS command is not accepted.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -225,7 +227,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You can use any
|
<p style="margin-left:6%; margin-top: 1em">You can use any
|
||||||
MUA (Mail User Agent) with SMTP authentication support. Set
|
MUA (Mail User Agent) with SMTP authentication support. Set
|
||||||
the client to use <i>internal_ip</i> and <i>port</i> as an
|
the client to use <i>internal_ip</i> and <i>port</i> as an
|
||||||
SMTP server. The address of the real SMTP server must be
|
SMTP server. The address of the real SMTP server must be
|
||||||
@@ -254,7 +256,7 @@ fails.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -262,7 +264,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
|
ftppr(8), proxy(8), socks(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -272,7 +274,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+76
-73
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>socks</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>socks</b> -
|
||||||
SOCKS 4/4.5/5 gateway service</p>
|
SOCKS 4/4.5/5 gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ SOCKS 4/4.5/5 gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>socks</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>socks</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
[<b>-p</b><i>port</i>] [<b>-i</b><i>internal_ip</i>]
|
||||||
[<b>-e</b><i>external_ip</i>]</p>
|
[<b>-e</b><i>external_ip</i>]</p>
|
||||||
@@ -42,7 +42,7 @@ SOCKS 4/4.5/5 gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>socks</b> is
|
<p style="margin-left:6%; margin-top: 1em"><b>socks</b> is
|
||||||
SOCKS server. It supports SOCKSv4, SOCKSv4.5 (extension to
|
SOCKS server. It supports SOCKSv4, SOCKSv4.5 (extension to
|
||||||
v4 for server side name resolution) and SOCKSv5. SOCKSv5
|
v4 for server side name resolution) and SOCKSv5. SOCKSv5
|
||||||
specification allows both outgoing and reverse TCP
|
specification allows both outgoing and reverse TCP
|
||||||
@@ -56,81 +56,82 @@ connections and UDP portmapping.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never ask for username authentication</p></td></tr>
|
<p style="margin-top: 1em">Never ask for username
|
||||||
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. External IP must be
|
the interface the proxy should initiate connections from.
|
||||||
specified if you need incoming connections. By default, the
|
External IP must be specified if you need incoming
|
||||||
system will decide which address to use in accordance with
|
connections. By default, the system will decide which
|
||||||
the routing table.</p></td></tr>
|
address to use in accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -141,13 +142,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-Ne</b></p></td>
|
<p><b>-Ne</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External NAT address 3proxy reports to client for
|
<p>External NAT address 3proxy reports to client for
|
||||||
@@ -156,75 +157,77 @@ and destination server. By default, the external address is
|
|||||||
reported. It’s only useful in the case of IP-IP NAT
|
reported. It’s only useful in the case of IP-IP NAT
|
||||||
and does not work with port translation.</p></td></tr>
|
and does not work with port translation.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-Ni</b></p></td>
|
<p style="margin-top: 1em"><b>-Ni</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal NAT address 3proxy reports to client for
|
<p style="margin-top: 1em">Internal NAT address 3proxy
|
||||||
UDPASSOC. This is external address of the NAT between 3proxy
|
reports to client for UDPASSOC. This is external address of
|
||||||
and the client, client uses to connect to 3proxy. By
|
the NAT between 3proxy and the client, client uses to
|
||||||
default, the internal address is reported. It’s only
|
connect to 3proxy. By default, the internal address is
|
||||||
useful in the case of IP-IP NAT and does not work with port
|
reported. It’s only useful in the case of IP-IP NAT
|
||||||
translation.</p> </td></tr>
|
and does not work with port translation.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p style="margin-top: 1em"><b>-i</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p style="margin-top: 1em">Internal address. IP address the
|
||||||
connections to. By default, connections to any interface are
|
proxy accepts connections to. By default, connections to any
|
||||||
accepted. It´s usually unsafe. Unix domain sockets can
|
interface are accepted. It´s usually unsafe. Unix
|
||||||
be specified with <i>-iunix:/path/to/socket</i> syntax
|
domain sockets can be specified with
|
||||||
(e.g., -iunix:/var/run/socks.sock). On Linux, abstract
|
<i>-iunix:/path/to/socket</i> syntax (e.g.,
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
-iunix:/var/run/socks.sock). On Linux, abstract sockets use
|
||||||
|
<i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Port. Port proxy listens for incoming connections.
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
Default is 1080.</p></td></tr>
|
incoming connections. Default is 1080.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ preceeds <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ preceeds
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -232,7 +235,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You should use a
|
<p style="margin-left:6%; margin-top: 1em">You should use a
|
||||||
client with SOCKS support or use some socksification support
|
client with SOCKS support or use some socksification support
|
||||||
(for example <i>SocksCAP</i> or <i>FreeCAP</i>). Configure
|
(for example <i>SocksCAP</i> or <i>FreeCAP</i>). Configure
|
||||||
client to use <i>internal_ip</i> and <i>port</i>. SOCKS
|
client to use <i>internal_ip</i> and <i>port</i>. SOCKS
|
||||||
@@ -247,7 +250,7 @@ privileges). If you need to control access, use
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -255,7 +258,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
proxy(8), ftppr(8), pop3p(8), tcppm(8), udppm(8),
|
proxy(8), ftppr(8), pop3p(8), tcppm(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -265,7 +268,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+52
-51
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>tcppm</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>tcppm</b> -
|
||||||
TCP port mapper</p>
|
TCP port mapper</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -33,7 +33,7 @@ TCP port mapper</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>tcppm</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>tcppm</b>
|
||||||
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-i</b><i>internal_ip</i>] [<b>-e</b><i>external_ip</i>]
|
[<b>-i</b><i>internal_ip</i>] [<b>-e</b><i>external_ip</i>]
|
||||||
<i>local_port remote_host remote_port</i></p>
|
<i>local_port remote_host remote_port</i></p>
|
||||||
@@ -44,7 +44,7 @@ TCP port mapper</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>tcppm</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>tcppm</b></i>
|
||||||
forwards connections from local to remote TCP port</p>
|
forwards connections from local to remote TCP port</p>
|
||||||
|
|
||||||
<h2>OPTIONS
|
<h2>OPTIONS
|
||||||
@@ -55,69 +55,69 @@ forwards connections from local to remote TCP port</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -128,13 +128,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -144,31 +144,32 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/tcppm.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/tcppm.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>ARGUMENTS
|
<h2>ARGUMENTS
|
||||||
@@ -177,23 +178,23 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i>local_port</i></p>
|
<p style="margin-left:6%; margin-top: 1em"><i>local_port</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- port tcppm accepts
|
<p style="margin-left:15%;">- port tcppm accepts
|
||||||
connections on</p>
|
connections on</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><i>remote_host</i></p>
|
<p style="margin-left:6%;"><i>remote_host</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- IP address of the host the
|
<p style="margin-left:15%;">- IP address of the host the
|
||||||
connection is forwarded to. Unix domain sockets can be
|
connection is forwarded to. Unix domain sockets can be
|
||||||
specified with the syntax <i>unix:/path/to/socket</i> (e.g.,
|
specified with the syntax <i>unix:/path/to/socket</i> (e.g.,
|
||||||
unix:/var/run/app.sock). On Linux, abstract (fileless) Unix
|
unix:/var/run/app.sock). On Linux, abstract (fileless) Unix
|
||||||
sockets use the syntax <i>unix:@socketname</i> (e.g.,
|
sockets use the syntax <i>unix:@socketname</i> (e.g.,
|
||||||
unix:@app.socket).</p>
|
unix:@app.socket).</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><i>remote_port</i></p>
|
<p style="margin-left:6%;"><i>remote_port</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- remote port the connection is
|
<p style="margin-left:15%;">- remote port the connection is
|
||||||
forwarded to. Ignored when using Unix socket destination,
|
forwarded to. Ignored when using Unix socket destination,
|
||||||
but must be specified (use any positive value) for syntax
|
but must be specified (use any positive value) for syntax
|
||||||
compatibility.</p>
|
compatibility.</p>
|
||||||
@@ -203,7 +204,7 @@ compatibility.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Any TCP-based
|
<p style="margin-left:6%; margin-top: 1em">Any TCP-based
|
||||||
application can be used as a client. Use <i>internal_ip</i>
|
application can be used as a client. Use <i>internal_ip</i>
|
||||||
and <i>local_port</i> as the destination in the client
|
and <i>local_port</i> as the destination in the client
|
||||||
application. The connection is forwarded to
|
application. The connection is forwarded to
|
||||||
@@ -214,7 +215,7 @@ application. The connection is forwarded to
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -222,7 +223,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
|
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -232,7 +233,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+88
-83
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>tlspr</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>tlspr</b> -
|
||||||
SNI proxy gateway service</p>
|
SNI proxy gateway service</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -32,7 +32,7 @@ SNI proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>tlspr</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>tlspr</b>
|
||||||
[<b>-d</b>][<b>-a</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-d</b>][<b>-a</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-p</b><i>listening_port</i>]
|
[<b>-p</b><i>listening_port</i>]
|
||||||
[<b>-P</b><i>destination_port</i>]
|
[<b>-P</b><i>destination_port</i>]
|
||||||
@@ -45,7 +45,7 @@ SNI proxy gateway service</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>tlspr</b> is
|
<p style="margin-left:6%; margin-top: 1em"><b>tlspr</b> is
|
||||||
an SNI gateway service (destination host is taken from TLS
|
an SNI gateway service (destination host is taken from TLS
|
||||||
handshake). The destination port must be specified via the
|
handshake). The destination port must be specified via the
|
||||||
-P option (or it may be detected with the Transparent
|
-P option (or it may be detected with the Transparent
|
||||||
@@ -61,80 +61,81 @@ access control is required.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Never ask for username authentication</p></td></tr>
|
<p style="margin-top: 1em">Never ask for username
|
||||||
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate connections from. By default, the system
|
the interface the proxy should initiate connections from. By
|
||||||
will decide which address to use in accordance with the
|
default, the system will decide which address to use in
|
||||||
routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -145,13 +146,13 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts
|
<p>Internal address. IP address the proxy accepts
|
||||||
@@ -161,90 +162,93 @@ be specified with <i>-iunix:/path/to/socket</i> syntax
|
|||||||
(e.g., -iunix:/var/run/tlspr.sock). On Linux, abstract
|
(e.g., -iunix:/var/run/tlspr.sock). On Linux, abstract
|
||||||
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-a</b></p></td>
|
<p style="margin-top: 1em"><b>-a</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Anonymous. Hide information about client.</p></td></tr>
|
<p style="margin-top: 1em">Anonymous. Hide information
|
||||||
|
about client.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-a1</b></p></td>
|
<p style="margin-top: 1em"><b>-a1</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Anonymous. Show fake information about client.</p></td></tr>
|
<p style="margin-top: 1em">Anonymous. Show fake information
|
||||||
|
about client.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-p</b></p></td>
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>listening_port. Port proxy listens for incoming
|
<p style="margin-top: 1em">listening_port. Port proxy
|
||||||
connections. Default is 1443.</p></td></tr>
|
listens for incoming connections. Default is 1443.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-P</b></p></td>
|
<p style="margin-top: 1em"><b>-P</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>destination_port. Port to establish outgoing
|
<p style="margin-top: 1em">destination_port. Port to
|
||||||
connections. Required unless the Transparent plugin is used,
|
establish outgoing connections. Required unless the
|
||||||
because the TLS handshake does not contain port information.
|
Transparent plugin is used, because the TLS handshake does
|
||||||
Default is 443.</p></td></tr>
|
not contain port information. Default is 443.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-c</b></p></td>
|
<p style="margin-top: 1em"><b>-c</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to
|
<p style="margin-top: 1em">TLS_CHECK_LEVEL. 0 (default) -
|
||||||
pass, 1 - require TLS, only check client HELLO packet, 2 -
|
allow non-TLS traffic to pass, 1 - require TLS, only check
|
||||||
require TLS, check both client and server HELLO, 3 - require
|
client HELLO packet, 2 - require TLS, check both client and
|
||||||
TLS, check that the server sends a certificate (not
|
server HELLO, 3 - require TLS, check that the server sends a
|
||||||
compatible with TLS 1.3), 4 - require mutual TLS, check that
|
certificate (not compatible with TLS 1.3), 4 - require
|
||||||
the server sends a certificate request and the client sends
|
mutual TLS, check that the server sends a certificate
|
||||||
a certificate (not compatible with TLS 1.3)</p></td></tr>
|
request and the client sends a certificate (not compatible
|
||||||
|
with TLS 1.3)</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-s</b></p></td>
|
<p style="margin-top: 1em"><b>-s</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Split the TLS Client HELLO packet across multiple TCP
|
<p style="margin-top: 1em">Split the TLS Client HELLO
|
||||||
segments to make SNI-based DPI detection harder. An optional
|
packet across multiple TCP segments to make SNI-based DPI
|
||||||
numeric value can follow (e.g. <b>-s1</b>) to control the
|
detection harder. An optional numeric value can follow (e.g.
|
||||||
splitting behaviour.</p></td></tr>
|
<b>-s1</b>) to control the splitting behaviour.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-Ximap | -Xpop3 |
|
<p style="margin-left:6%;"><b>-Ximap | -Xpop3 |
|
||||||
-Xsmtp</b></p>
|
-Xsmtp</b></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">STARTTLS mode for the given
|
<p style="margin-left:15%;">STARTTLS mode for the given
|
||||||
protocol. The proxy speaks the plaintext protocol with the
|
protocol. The proxy speaks the plaintext protocol with the
|
||||||
client (greeting, capability advertisement with STARTTLS
|
client (greeting, capability advertisement with STARTTLS
|
||||||
only, STARTTLS command), then, after the client issues
|
only, STARTTLS command), then, after the client issues
|
||||||
@@ -258,13 +262,13 @@ client fails.</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
||||||
@@ -272,17 +276,18 @@ is specified logging is to file. Under Unix, if
|
|||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
||||||
used for logging.</p></td></tr>
|
used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -290,7 +295,7 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">You should use a
|
<p style="margin-left:6%; margin-top: 1em">You should use a
|
||||||
client with TLS support or configure a router to redirect
|
client with TLS support or configure a router to redirect
|
||||||
TLS traffic to the proxy (transparent proxy). Configure the
|
TLS traffic to the proxy (transparent proxy). Configure the
|
||||||
client to connect to <i>internal_ip</i> and <i>port</i>. If
|
client to connect to <i>internal_ip</i> and <i>port</i>. If
|
||||||
@@ -301,7 +306,7 @@ you need to limit clients, use <b>3proxy</b>(8) instead.</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -309,7 +314,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
ftppr(8), proxy(8), socks(8), pop3p(8), smtpp(8), tcppm(8),
|
ftppr(8), proxy(8), socks(8), pop3p(8), smtpp(8), tcppm(8),
|
||||||
udppm(8), syslogd(8), <br>
|
udppm(8), syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -319,7 +324,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+61
-59
@@ -1,4 +1,4 @@
|
|||||||
<!-- Creator : groff version 1.23.0 -->
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>udppm</b> -
|
<p style="margin-left:6%; margin-top: 1em"><b>udppm</b> -
|
||||||
UDP port mapper</p>
|
UDP port mapper</p>
|
||||||
|
|
||||||
<h2>SYNOPSIS
|
<h2>SYNOPSIS
|
||||||
@@ -33,7 +33,7 @@ UDP port mapper</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><b>udppm</b>
|
<p style="margin-left:6%; margin-top: 1em"><b>udppm</b>
|
||||||
[<b>-ds</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
[<b>-ds</b>] [<b>-l</b>[[<i>@</i>]<i>logfile</i>]]
|
||||||
[<b>-i</b><i>internal_ip</i>] [<b>-e</b><i>external_ip</i>]
|
[<b>-i</b><i>internal_ip</i>] [<b>-e</b><i>external_ip</i>]
|
||||||
<i>local_port remote_host remote_port</i></p>
|
<i>local_port remote_host remote_port</i></p>
|
||||||
@@ -44,7 +44,7 @@ UDP port mapper</p>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i><b>udppm</b></i>
|
<p style="margin-left:6%; margin-top: 1em"><i><b>udppm</b></i>
|
||||||
forwards datagrams from local to remote UDP port</p>
|
forwards datagrams from local to remote UDP port</p>
|
||||||
|
|
||||||
<h2>OPTIONS
|
<h2>OPTIONS
|
||||||
@@ -55,69 +55,69 @@ forwards datagrams from local to remote UDP port</p>
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-I</b></p></td>
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Inetd mode. Standalone service
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Daemonize. Detach service from console and run in the
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
background.</p> </td></tr>
|
console and run in the background.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Be silenT. Do not log start/stop/accept error
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
records.</p> </td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>External address. IP address of the interface the proxy
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
should initiate datagrams from. By default, the system will
|
the interface the proxy should initiate datagrams from. By
|
||||||
decide which address to use in accordance with the routing
|
default, the system will decide which address to use in
|
||||||
table.</p> </td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ni</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> before opening
|
network namespace identified by <i>PATH</i> before opening
|
||||||
the listening socket. The current namespace is saved and
|
the listening socket. The current namespace is saved and
|
||||||
restored immediately after binding, so outgoing connections
|
restored immediately after binding, so outgoing connections
|
||||||
run in the original namespace unless <b>-ne</b> is also
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
given.</p>
|
given.</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><b>-ne</b><i>PATH</i></p>
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">(Linux only) Switch to the
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
network namespace identified by <i>PATH</i> after the
|
network namespace identified by <i>PATH</i> after the
|
||||||
listening socket has been bound (and after restoring from
|
listening socket has been bound (and after restoring from
|
||||||
<b>-ni</b> if applicable). Both options accept any namespace
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
@@ -128,59 +128,61 @@ file path (e.g. <i>/var/run/netns/myns</i> or
|
|||||||
<table width="100%" border="0" rules="none" frame="void"
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Internal address. IP address the proxy accepts datagrams
|
<p>Internal address. IP address the proxy accepts datagrams
|
||||||
to. By default, connections to any interface are accepted.
|
to. By default, connections to any interface are accepted.
|
||||||
It´s usually unsafe.</p></td></tr>
|
It´s usually unsafe.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
is specified logging is to file. Under Unix, if
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
used for logging.</p></td></tr>
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-s</b></p></td>
|
<p style="margin-top: 1em"><b>-s</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Single packet. By default, only one client can use the
|
<p style="margin-top: 1em">Single packet. By default, only
|
||||||
udppm service, but if -s is specified, only one packet will
|
one client can use the udppm service, but if -s is
|
||||||
be forwarded between client and server. This allows the
|
specified, only one packet will be forwarded between client
|
||||||
service to be shared between multiple clients for
|
and server. This allows the service to be shared between
|
||||||
single-packet services (for example, name lookups).</p></td></tr>
|
multiple clients for single-packet services (for example,
|
||||||
|
name lookups).</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="9%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="82%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p>Increase or decrease stack size. You may want to try
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>ARGUMENTS
|
<h2>ARGUMENTS
|
||||||
@@ -189,19 +191,19 @@ something like -S8192 if you experience 3proxy crashes.</p></td></tr>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em"><i>local_port</i></p>
|
<p style="margin-left:6%; margin-top: 1em"><i>local_port</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- port udppm accepts datagrams
|
<p style="margin-left:15%;">- port udppm accepts datagrams
|
||||||
on</p>
|
on</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><i>remote_host</i></p>
|
<p style="margin-left:6%;"><i>remote_host</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- IP address of the host
|
<p style="margin-left:15%;">- IP address of the host
|
||||||
datagrams are forwarded to</p>
|
datagrams are forwarded to</p>
|
||||||
|
|
||||||
<p style="margin-left:9%;"><i>remote_port</i></p>
|
<p style="margin-left:6%;"><i>remote_port</i></p>
|
||||||
|
|
||||||
<p style="margin-left:18%;">- remote port datagrams are
|
<p style="margin-left:15%;">- remote port datagrams are
|
||||||
forwarded to</p>
|
forwarded to</p>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
@@ -209,7 +211,7 @@ forwarded to</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Any UDP-based
|
<p style="margin-left:6%; margin-top: 1em">Any UDP-based
|
||||||
application can be used as a client. Use <i>internal_ip</i>
|
application can be used as a client. Use <i>internal_ip</i>
|
||||||
and <i>local_port</i> as the destination in the client
|
and <i>local_port</i> as the destination in the client
|
||||||
application. All datagrams are forwarded to
|
application. All datagrams are forwarded to
|
||||||
@@ -220,7 +222,7 @@ application. All datagrams are forwarded to
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">Report all bugs
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
to <b>3proxy@3proxy.org</b></p>
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
<h2>SEE ALSO
|
<h2>SEE ALSO
|
||||||
@@ -228,7 +230,7 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy(8),
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
|
proxy(8), ftppr(8), socks(8), pop3p(8), udppm(8),
|
||||||
syslogd(8), <br>
|
syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
@@ -238,7 +240,7 @@ https://3proxy.org/</p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:9%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+24
-6
@@ -190,15 +190,21 @@ any protocol-specific data.
|
|||||||
.B -g(\fIGRACE_TRAFF\fB,\fIGRACE_NUM\fB,\fIGRACE_DELAY\fR)
|
.B -g(\fIGRACE_TRAFF\fB,\fIGRACE_NUM\fB,\fIGRACE_DELAY\fR)
|
||||||
delay GRACE_DELAY milliseconds before polling if average polling size is below GRACE_TRAFF bytes and GRACE_NUM read operations in a single direction are detected within 1 second. Useful to minimize polling
|
delay GRACE_DELAY milliseconds before polling if average polling size is below GRACE_TRAFF bytes and GRACE_NUM read operations in a single direction are detected within 1 second. Useful to minimize polling
|
||||||
.br
|
.br
|
||||||
|
.B -B
|
||||||
|
(for TCP services) split the TLS ClientHello across two TCP segments in the
|
||||||
|
middle of the server name (SNI) when it is passed through tlspr, as with
|
||||||
|
\fBparent ... tls 0.0.0.0 0\fR: some DPI systems looking for blocked host names
|
||||||
|
do not reassemble it. Use with \fB-ocTCP_NODELAY -osTCP_NODELAY\fR, or the kernel
|
||||||
|
may join the segments again. In builds without splice() \fB-s\fR does the same.
|
||||||
|
.br
|
||||||
.B -s
|
.B -s
|
||||||
(for admin) secure, allow only secure operations, currently only traffic counters
|
(for admin) secure, allow only secure operations, currently only traffic counters
|
||||||
view without ability to reset.
|
view without ability to reset.
|
||||||
.br
|
.br
|
||||||
(for TCP services, Linux) enable splice(). splice() is not built by default and
|
(for TCP services, Linux) enable splice(). It is built on Linux by default,
|
||||||
is disabled even when built, because current Linux does not implement
|
but off unless -s is given: splice() is faster for large transfers and the
|
||||||
SPLICE_F_MOVE, so no real zero-copy takes place and the read/write path is faster
|
read/write path for small requests. -s0 disables it explicitly; build without
|
||||||
for most traffic. Rebuild with -DWITHSPLICE to make -s available, -s0 disables it
|
-DWITHSPLICE to leave it out.
|
||||||
explicitly.
|
|
||||||
.br
|
.br
|
||||||
.B -C
|
.B -C
|
||||||
(for TCP services) a connection closed by any of the sides terminates the
|
(for TCP services) a connection closed by any of the sides terminates the
|
||||||
@@ -514,6 +520,13 @@ system routines for name resolution is
|
|||||||
used. Optional port number may be specified.
|
used. Optional port number may be specified.
|
||||||
If optional /tcp is added to IP address, name resolution is
|
If optional /tcp is added to IP address, name resolution is
|
||||||
performed over TCP.
|
performed over TCP.
|
||||||
|
An IPv6 address has to be enclosed in square brackets:
|
||||||
|
.br
|
||||||
|
\fBnserver 1.1.1.1\fR
|
||||||
|
.br
|
||||||
|
\fBnserver [2001:4860:4860::8844]\fR
|
||||||
|
.br
|
||||||
|
\fBnserver [2001:4860:4860::8844]:5353/tcp\fR
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.BR authnserver
|
.BR authnserver
|
||||||
@@ -1247,7 +1260,12 @@ for all threads.
|
|||||||
.BR chroot
|
.BR chroot
|
||||||
\fI<path>\fR [\fI<uid>\fR] [\fI<gid>\fR]
|
\fI<path>\fR [\fI<uid>\fR] [\fI<gid>\fR]
|
||||||
.br
|
.br
|
||||||
calls chroot(path) and sets gid/uid. Unix only. uid/gid supported since 0.9, can be numeric or username/groupname
|
calls chroot(path) and sets gid/uid. Unix only. uid/gid supported since 0.9, can be numeric or username/groupname.
|
||||||
|
The time zone and the syslog connection are set up before the call.
|
||||||
|
Plugins which read their own configuration or load modules while running need them inside the chroot:
|
||||||
|
PAM (\fI/etc/pam.d\fR and the modules it names, read for every authentication),
|
||||||
|
LDAP (\fIldap.conf\fR and, for ldaps, the CA certificates),
|
||||||
|
ODBC (\fIodbc.ini\fR, \fIodbcinst.ini\fR and the driver libraries, loaded again whenever the connection is reopened).
|
||||||
|
|
||||||
.br
|
.br
|
||||||
.BR stacksize
|
.BR stacksize
|
||||||
|
|||||||
+2
-2
@@ -76,8 +76,8 @@ destination_port. Port to establish outgoing connections. Required unless the Tr
|
|||||||
.B -c
|
.B -c
|
||||||
TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to pass, 1 - require TLS, only check client HELLO packet, 2 - require TLS, check both client and server HELLO, 3 - require TLS, check that the server sends a certificate (not compatible with TLS 1.3), 4 - require mutual TLS, check that the server sends a certificate request and the client sends a certificate (not compatible with TLS 1.3)
|
TLS_CHECK_LEVEL. 0 (default) - allow non-TLS traffic to pass, 1 - require TLS, only check client HELLO packet, 2 - require TLS, check both client and server HELLO, 3 - require TLS, check that the server sends a certificate (not compatible with TLS 1.3), 4 - require mutual TLS, check that the server sends a certificate request and the client sends a certificate (not compatible with TLS 1.3)
|
||||||
.TP
|
.TP
|
||||||
.B -s
|
.B -B
|
||||||
Split the TLS Client HELLO packet across multiple TCP segments to make SNI-based DPI detection harder. An optional numeric value can follow (e.g. \fB-s1\fR) to control the splitting behaviour.
|
Split the TLS Client HELLO packet across two TCP segments, in the middle of the SNI, to make SNI-based DPI detection harder. In builds without splice() \fB-s\fR does the same; with splice() (Linux) \fB-s\fR is splice, see \fB3proxy.cfg\fR(5).
|
||||||
.TP
|
.TP
|
||||||
.B -Ximap | -Xpop3 | -Xsmtp
|
.B -Ximap | -Xpop3 | -Xsmtp
|
||||||
STARTTLS mode for the given protocol. The proxy speaks the plaintext protocol
|
STARTTLS mode for the given protocol. The proxy speaks the plaintext protocol
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2026 3proxy.org
|
||||||
|
#
|
||||||
|
# This is free software, licensed under the BSD 3-Clause License.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=3proxy
|
||||||
|
PKG_VERSION:=0.9.9.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
# A trailing ? tells the download helper the URL is complete and PKG_SOURCE
|
||||||
|
# must not be appended to it.
|
||||||
|
PKG_SOURCE_URL:=https://codeload.github.com/3proxy/3proxy/tar.gz/refs/tags/$(PKG_VERSION)?
|
||||||
|
PKG_HASH:=5af253fa734f61af6d5fe3790022130a14caf25bfce24a6aefd415797d351dd3
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Vladimir Dubrovin <vlad@3proxy.org>
|
||||||
|
PKG_LICENSE:=BSD-3-Clause
|
||||||
|
PKG_LICENSE_FILES:=copying
|
||||||
|
PKG_CPE_ID:=cpe:/a:3proxy:3proxy
|
||||||
|
|
||||||
|
PKG_BUILD_PARALLEL:=1
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/3proxy
|
||||||
|
SECTION:=net
|
||||||
|
CATEGORY:=Network
|
||||||
|
SUBMENU:=Web Servers/Proxies
|
||||||
|
TITLE:=tiny free proxy server
|
||||||
|
URL:=https://3proxy.org/
|
||||||
|
DEPENDS:=+libopenssl +libpcre2
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/3proxy/description
|
||||||
|
3proxy is a tiny free proxy server supporting HTTP, HTTPS, FTP, SOCKS v4/v4a/v5,
|
||||||
|
POP3, SMTP, IMAP, TCP and UDP port mapping, with access control, bandwidth
|
||||||
|
limiting and traffic accounting.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/3proxy/conffiles
|
||||||
|
/etc/config/3proxy
|
||||||
|
endef
|
||||||
|
|
||||||
|
# Makefile.Linux appends to CFLAGS and LDFLAGS internally; the target flags have
|
||||||
|
# to be added rather than substituted, or the defines it relies on are lost.
|
||||||
|
define Build/Compile
|
||||||
|
$(MAKE) -C $(PKG_BUILD_DIR) -f Makefile.Linux \
|
||||||
|
CC="$(TARGET_CC)" \
|
||||||
|
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
|
||||||
|
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||||
|
PLUGINS=
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/3proxy/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/3proxy $(1)/usr/bin/3proxy
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) ./files/3proxy.config $(1)/etc/config/3proxy
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/3proxy.init $(1)/etc/init.d/3proxy
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,3proxy))
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
config 3proxy 'global'
|
||||||
|
option enabled '0'
|
||||||
|
option nscache '65536'
|
||||||
|
# option nscache6 '65536'
|
||||||
|
# static records, added to the cache; 0.0.0.0 blackholes a name
|
||||||
|
# list nsrecord 'ads.example.com 0.0.0.0'
|
||||||
|
option maxconn '128'
|
||||||
|
option auth 'iponly'
|
||||||
|
option log 'syslog'
|
||||||
|
# option timeouts '1 5 30 60 180 1800 15 60 15 5 5'
|
||||||
|
# list include '/etc/3proxy/extra.cfg'
|
||||||
|
list nserver '8.8.8.8'
|
||||||
|
list nserver '8.8.4.4'
|
||||||
|
# list user 'admin:CL:password'
|
||||||
|
# list extra_config 'timeouts 1 5 30 60 180 1800 15 60'
|
||||||
|
# access list used by services which do not define their own
|
||||||
|
list acl 'lan'
|
||||||
|
|
||||||
|
# Access rules are named sections referenced by services. The order of the
|
||||||
|
# references decides precedence: 3proxy stops at the first rule that matches.
|
||||||
|
config acl 'lan'
|
||||||
|
option action 'allow'
|
||||||
|
option src '192.168.1.0/24'
|
||||||
|
|
||||||
|
config acl 'deny_private'
|
||||||
|
option action 'deny'
|
||||||
|
option dst '10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
|
||||||
|
|
||||||
|
#config acl 'via_upstream'
|
||||||
|
# option action 'allow'
|
||||||
|
# list parent 'upstream'
|
||||||
|
|
||||||
|
# Parent proxies extend an allow rule to build a chain. Weights group them:
|
||||||
|
# parents whose weights sum to 1000 form one group and one is picked at random,
|
||||||
|
# several groups are chained in order.
|
||||||
|
#config parent 'upstream'
|
||||||
|
# option weight '1000'
|
||||||
|
# option type 'socks5'
|
||||||
|
# option ip '10.0.0.1'
|
||||||
|
# option port '1080'
|
||||||
|
# option username ''
|
||||||
|
# option password ''
|
||||||
|
|
||||||
|
config service 'proxy'
|
||||||
|
option enabled '0'
|
||||||
|
option type 'proxy'
|
||||||
|
option port '3128'
|
||||||
|
# option bind ''
|
||||||
|
# option external ''
|
||||||
|
# option extra ''
|
||||||
|
# option auth 'strong'
|
||||||
|
list acl 'deny_private'
|
||||||
|
list acl 'lan'
|
||||||
|
|
||||||
|
config service 'socks'
|
||||||
|
option enabled '0'
|
||||||
|
option type 'socks'
|
||||||
|
option port '1080'
|
||||||
|
list acl 'lan'
|
||||||
@@ -0,0 +1,460 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=50
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
CFGFILE=/var/etc/3proxy.cfg
|
||||||
|
PROG=/usr/bin/3proxy
|
||||||
|
|
||||||
|
# 3proxy.cfg is order dependent: authentication and access rules apply to the
|
||||||
|
# service lines that follow them, and the access list has to be flushed before
|
||||||
|
# each service. The file is written as one global block followed by one block
|
||||||
|
# per service.
|
||||||
|
|
||||||
|
acl_written=0
|
||||||
|
|
||||||
|
append_line() {
|
||||||
|
echo "$1" >> "$CFGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
append_include() {
|
||||||
|
echo "include $1" >> "$CFGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
# The limiter directives carry their own ACL pattern rather than attaching to a
|
||||||
|
# preceding allow rule, and 3proxy defaults every omitted field to *, so the
|
||||||
|
# trailing wildcards are dropped again to keep the file readable.
|
||||||
|
# logformat takes a single argument, so a format containing spaces has to be
|
||||||
|
# quoted. Quotes already present in the UCI value are not doubled.
|
||||||
|
append_logformat() {
|
||||||
|
local fmt="$1"
|
||||||
|
|
||||||
|
case "$fmt" in
|
||||||
|
'"'*'"') ;;
|
||||||
|
*) fmt="\"$fmt\"" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "logformat $fmt" >> "$CFGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
limit_match() {
|
||||||
|
local users src dst ports ops weekdays periods out
|
||||||
|
|
||||||
|
config_get users "$1" users '*'
|
||||||
|
config_get src "$1" src '*'
|
||||||
|
config_get dst "$1" dst '*'
|
||||||
|
config_get ports "$1" ports '*'
|
||||||
|
config_get ops "$1" operations '*'
|
||||||
|
config_get weekdays "$1" weekdays '*'
|
||||||
|
config_get periods "$1" timeperiods '*'
|
||||||
|
|
||||||
|
out="$users $src $dst $ports $ops $weekdays $periods"
|
||||||
|
while [ "${out% \*}" != "$out" ]; do out="${out% \*}"; done
|
||||||
|
|
||||||
|
echo "$out"
|
||||||
|
}
|
||||||
|
|
||||||
|
append_limit() {
|
||||||
|
local type rate period number count_type limit match
|
||||||
|
|
||||||
|
config_get type "$1" type
|
||||||
|
|
||||||
|
case "$type" in
|
||||||
|
bandlimin|bandlimout|nobandlimin|nobandlimout|\
|
||||||
|
connlim|noconnlim|\
|
||||||
|
countin|countout|countall|nocountin|nocountout|nocountall) ;;
|
||||||
|
*)
|
||||||
|
echo "3proxy: limit '$1' has unknown type '$type', ignored" >&2
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
match=$(limit_match "$1")
|
||||||
|
|
||||||
|
case "$type" in
|
||||||
|
bandlimin|bandlimout)
|
||||||
|
config_get rate "$1" rate
|
||||||
|
[ -n "$rate" ] || {
|
||||||
|
echo "3proxy: limit '$1' needs a rate, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
echo "$type $rate $match" >> "$CFGFILE"
|
||||||
|
;;
|
||||||
|
connlim)
|
||||||
|
config_get rate "$1" rate
|
||||||
|
config_get period "$1" period 0
|
||||||
|
[ -n "$rate" ] || {
|
||||||
|
echo "3proxy: limit '$1' needs a rate, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
echo "$type $rate $period $match" >> "$CFGFILE"
|
||||||
|
;;
|
||||||
|
countin|countout|countall)
|
||||||
|
config_get number "$1" number
|
||||||
|
config_get count_type "$1" count_type
|
||||||
|
config_get limit "$1" limit
|
||||||
|
[ -n "$number" ] && [ -n "$count_type" ] && [ -n "$limit" ] || {
|
||||||
|
echo "3proxy: limit '$1' needs number, count_type and limit, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
echo "$type $number $count_type $limit $match" >> "$CFGFILE"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$type $match" >> "$CFGFILE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
append_pcre_extend() {
|
||||||
|
echo "pcre_extend $1" >> "$CFGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
append_pcre() {
|
||||||
|
local match_type action regexp rewrite ace
|
||||||
|
|
||||||
|
config_get match_type "$1" match_type
|
||||||
|
config_get action "$1" action
|
||||||
|
config_get regexp "$1" regexp
|
||||||
|
config_get rewrite "$1" rewrite
|
||||||
|
config_get ace "$1" ace
|
||||||
|
|
||||||
|
[ -n "$match_type" ] && [ -n "$action" ] && [ -n "$regexp" ] || {
|
||||||
|
echo "3proxy: pcre '$1' needs match_type, action and regexp, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Catch bad values here: 3proxy rejects the whole configuration on an
|
||||||
|
# unknown type or action, which would leave the router without a proxy.
|
||||||
|
case "$action" in
|
||||||
|
allow|deny|dunno) ;;
|
||||||
|
*)
|
||||||
|
echo "3proxy: pcre '$1' action '$action' is not allow, deny or dunno, ignored" >&2
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local part
|
||||||
|
for part in $(echo "$match_type" | tr ',' ' '); do
|
||||||
|
case "$part" in
|
||||||
|
request|cliheader|srvheader|clidata|srvdata) ;;
|
||||||
|
*)
|
||||||
|
echo "3proxy: pcre '$1' match_type '$part' is unknown, ignored" >&2
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$rewrite" ]; then
|
||||||
|
echo "pcre_rewrite $match_type $action $regexp $rewrite${ace:+ $ace}" >> "$CFGFILE"
|
||||||
|
else
|
||||||
|
echo "pcre $match_type $action $regexp${ace:+ $ace}" >> "$CFGFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
config_list_foreach "$1" extend append_pcre_extend
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
append_nsrecord() {
|
||||||
|
set -- $1
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "3proxy: nsrecord '$*' needs a hostname and an address, ignored" >&2
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "nsrecord $1 $2" >> "$CFGFILE"
|
||||||
|
nsrecord_written=1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
append_nserver() {
|
||||||
|
echo "nserver $1" >> "$CFGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
append_user() {
|
||||||
|
users="$users $1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1 is the name of an acl section referenced by a service, or by the global
|
||||||
|
# section as the default access list.
|
||||||
|
append_acl() {
|
||||||
|
local action users src dst ports
|
||||||
|
|
||||||
|
config_get action "$1" action allow
|
||||||
|
config_get users "$1" users
|
||||||
|
config_get src "$1" src
|
||||||
|
config_get dst "$1" dst
|
||||||
|
config_get ports "$1" ports
|
||||||
|
|
||||||
|
case "$action" in
|
||||||
|
allow|deny) ;;
|
||||||
|
*)
|
||||||
|
echo "3proxy: acl '$1' has unknown action '$action', ignored" >&2
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "$action ${users:-*} ${src:-*} ${dst:-*} ${ports:-*}" >> "$CFGFILE"
|
||||||
|
acl_written=1
|
||||||
|
|
||||||
|
if [ "$action" = "allow" ]; then
|
||||||
|
config_list_foreach "$1" parent append_parent
|
||||||
|
else
|
||||||
|
config_get _parent "$1" parent
|
||||||
|
[ -z "$_parent" ] || echo "3proxy: acl '$1' is a deny rule, its parents are ignored" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1 is the name of a parent section referenced by an acl. "parent" extends the
|
||||||
|
# allow rule that precedes it, so these are emitted directly after their rule.
|
||||||
|
append_parent() {
|
||||||
|
local weight type ip port username password line
|
||||||
|
|
||||||
|
config_get weight "$1" weight 1000
|
||||||
|
config_get type "$1" type
|
||||||
|
config_get ip "$1" ip
|
||||||
|
config_get port "$1" port
|
||||||
|
config_get username "$1" username
|
||||||
|
config_get password "$1" password
|
||||||
|
|
||||||
|
[ -n "$type" ] && [ -n "$ip" ] && [ -n "$port" ] || {
|
||||||
|
echo "3proxy: parent '$1' needs type, ip and port, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
line="parent $weight $type $ip $port"
|
||||||
|
if [ -n "$username" ]; then
|
||||||
|
line="$line $username"
|
||||||
|
[ -n "$password" ] && line="$line $password"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$line" >> "$CFGFILE"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# TLS parameters that take a value. The UCI option name is the directive name.
|
||||||
|
SSL_VALUE_OPTIONS="ssl_server_cert ssl_server_key ssl_client_cert ssl_client_key
|
||||||
|
ssl_client_ciphersuites ssl_server_ciphersuites
|
||||||
|
ssl_client_cipher_list ssl_server_cipher_list
|
||||||
|
ssl_client_min_proto_version ssl_server_min_proto_version
|
||||||
|
ssl_client_max_proto_version ssl_server_max_proto_version
|
||||||
|
ssl_server_ca_file ssl_server_ca_key ssl_server_ca_dir ssl_server_ca_store
|
||||||
|
ssl_client_ca_file ssl_client_ca_dir ssl_client_ca_store
|
||||||
|
ssl_client_sni ssl_client_alpn ssl_client_mode ssl_certcache"
|
||||||
|
|
||||||
|
# The TLS switches apply to every service below them, so they leak from one
|
||||||
|
# service to the next unless turned back off. These track what is currently in
|
||||||
|
# effect - all off, matching the defaults - so a directive is written only when
|
||||||
|
# a service actually needs a different state.
|
||||||
|
ssl_state_mitm=0
|
||||||
|
ssl_state_server=0
|
||||||
|
ssl_state_client=0
|
||||||
|
ssl_state_client_verify=0
|
||||||
|
ssl_state_server_verify=0
|
||||||
|
|
||||||
|
# $1 section, $2 uci option, $3 state variable, $4 directive on, $5 directive off
|
||||||
|
append_ssl_toggle() {
|
||||||
|
local want have
|
||||||
|
|
||||||
|
config_get_bool want "$1" "$2" 0
|
||||||
|
have=$(eval echo \$$3)
|
||||||
|
|
||||||
|
[ "$want" = "$have" ] && return 0
|
||||||
|
|
||||||
|
if [ "$want" -gt 0 ]; then
|
||||||
|
echo "$4" >> "$CFGFILE"
|
||||||
|
else
|
||||||
|
echo "$5" >> "$CFGFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval "$3=$want"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
append_ssl() {
|
||||||
|
local opt value mitm server cert key cverify
|
||||||
|
|
||||||
|
for opt in $SSL_VALUE_OPTIONS; do
|
||||||
|
config_get value "$1" "$opt"
|
||||||
|
[ -n "$value" ] && echo "$opt $value" >> "$CFGFILE"
|
||||||
|
done
|
||||||
|
|
||||||
|
append_ssl_toggle "$1" ssl_mitm ssl_state_mitm ssl_mitm ssl_nomitm
|
||||||
|
append_ssl_toggle "$1" ssl_server ssl_state_server ssl_serv ssl_noserv
|
||||||
|
append_ssl_toggle "$1" ssl_client ssl_state_client ssl_cli ssl_nocli
|
||||||
|
append_ssl_toggle "$1" ssl_client_verify ssl_state_client_verify \
|
||||||
|
ssl_client_verify ssl_client_no_verify
|
||||||
|
append_ssl_toggle "$1" ssl_server_verify ssl_state_server_verify \
|
||||||
|
ssl_server_verify ssl_server_no_verify
|
||||||
|
|
||||||
|
config_get_bool mitm "$1" ssl_mitm 0
|
||||||
|
config_get_bool cverify "$1" ssl_client_verify 0
|
||||||
|
[ "$mitm" -gt 0 ] && [ "$cverify" -gt 0 ] || [ "$mitm" -eq 0 ] || \
|
||||||
|
echo "3proxy: service '$1' spoofs certificates without ssl_client_verify, upstream certificates are not checked" >&2
|
||||||
|
|
||||||
|
config_get_bool server "$1" ssl_server 0
|
||||||
|
if [ "$server" -gt 0 ]; then
|
||||||
|
config_get cert "$1" ssl_server_cert
|
||||||
|
config_get key "$1" ssl_server_key
|
||||||
|
[ -n "$cert" ] && [ -n "$key" ] || \
|
||||||
|
echo "3proxy: service '$1' requires TLS from clients but has no ssl_server_cert/ssl_server_key" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
append_service() {
|
||||||
|
local enabled type port bind external extra auth args
|
||||||
|
local bind_interface external_interface logformat
|
||||||
|
|
||||||
|
config_get_bool enabled "$1" enabled 0
|
||||||
|
[ "$enabled" -gt 0 ] || return 0
|
||||||
|
|
||||||
|
config_get type "$1" type
|
||||||
|
[ -n "$type" ] || {
|
||||||
|
echo "3proxy: service '$1' has no type, ignored" >&2
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
config_get port "$1" port
|
||||||
|
config_get bind "$1" bind
|
||||||
|
config_get external "$1" external
|
||||||
|
config_get extra "$1" extra
|
||||||
|
config_get bind_interface "$1" bind_interface
|
||||||
|
config_get external_interface "$1" external_interface
|
||||||
|
config_get logformat "$1" logformat
|
||||||
|
config_get auth "$1" auth "$global_auth"
|
||||||
|
|
||||||
|
echo "" >> "$CFGFILE"
|
||||||
|
echo "flush" >> "$CFGFILE"
|
||||||
|
[ -n "$auth" ] && echo "auth $auth" >> "$CFGFILE"
|
||||||
|
|
||||||
|
# Rules referenced by the service, in the order they are listed. A service
|
||||||
|
# without its own list falls back to the global one.
|
||||||
|
acl_written=0
|
||||||
|
config_list_foreach "$1" acl append_acl
|
||||||
|
[ "$acl_written" -gt 0 ] || config_list_foreach global acl append_acl
|
||||||
|
|
||||||
|
[ -n "$logformat" ] && append_logformat "$logformat"
|
||||||
|
|
||||||
|
append_ssl "$1"
|
||||||
|
|
||||||
|
args=""
|
||||||
|
[ -n "$port" ] && args="$args -p$port"
|
||||||
|
[ -n "$bind" ] && args="$args -i$bind"
|
||||||
|
[ -n "$external" ] && args="$args -e$external"
|
||||||
|
[ -n "$bind_interface" ] && args="$args -Di$bind_interface"
|
||||||
|
[ -n "$external_interface" ] && args="$args -De$external_interface"
|
||||||
|
[ -n "$extra" ] && args="$args $extra"
|
||||||
|
|
||||||
|
echo "$type$args" >> "$CFGFILE"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
write_config() {
|
||||||
|
local nscache nscache6 maxconn log timeouts fakeresolve logformat
|
||||||
|
local authcache_type authcache_time authcache_size
|
||||||
|
local counter_file counter_type counter_name pcre_options
|
||||||
|
|
||||||
|
mkdir -p "$(dirname "$CFGFILE")"
|
||||||
|
: > "$CFGFILE"
|
||||||
|
|
||||||
|
config_get nscache global nscache
|
||||||
|
config_get nscache6 global nscache6
|
||||||
|
config_get maxconn global maxconn
|
||||||
|
config_get global_auth global auth iponly
|
||||||
|
config_get log global log syslog
|
||||||
|
config_get timeouts global timeouts
|
||||||
|
config_get logformat global logformat
|
||||||
|
config_get_bool fakeresolve global fakeresolve 0
|
||||||
|
config_get authcache_type global authcache_type
|
||||||
|
config_get authcache_time global authcache_time
|
||||||
|
config_get authcache_size global authcache_size
|
||||||
|
config_get counter_file global counter_file
|
||||||
|
config_get counter_type global counter_type
|
||||||
|
config_get counter_name global counter_name
|
||||||
|
config_get pcre_options global pcre_options
|
||||||
|
|
||||||
|
config_list_foreach global nserver append_nserver
|
||||||
|
[ -n "$nscache" ] && echo "nscache $nscache" >> "$CFGFILE"
|
||||||
|
[ -n "$nscache6" ] && echo "nscache6 $nscache6" >> "$CFGFILE"
|
||||||
|
|
||||||
|
# Static records are added to the cache, so they have to come after it.
|
||||||
|
nsrecord_written=0
|
||||||
|
config_list_foreach global nsrecord append_nsrecord
|
||||||
|
[ "$nsrecord_written" -eq 0 ] || [ -n "$nscache$nscache6" ] || \
|
||||||
|
echo "3proxy: nsrecord needs nscache or nscache6 to be set" >&2
|
||||||
|
|
||||||
|
case "$log" in
|
||||||
|
syslog) echo "log" >> "$CFGFILE" ;;
|
||||||
|
none|"") ;;
|
||||||
|
*) echo "log $log" >> "$CFGFILE" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
users=""
|
||||||
|
config_list_foreach global user append_user
|
||||||
|
[ -n "$users" ] && echo "users$users" >> "$CFGFILE"
|
||||||
|
|
||||||
|
[ -n "$timeouts" ] && echo "timeouts $timeouts" >> "$CFGFILE"
|
||||||
|
[ "$fakeresolve" -gt 0 ] && echo "fakeresolve" >> "$CFGFILE"
|
||||||
|
[ -n "$logformat" ] && append_logformat "$logformat"
|
||||||
|
|
||||||
|
if [ -n "$authcache_type" ]; then
|
||||||
|
[ -n "$authcache_time" ] || authcache_time=600
|
||||||
|
echo "authcache $authcache_type $authcache_time${authcache_size:+ $authcache_size}" >> "$CFGFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$counter_file" ]; then
|
||||||
|
echo "counter $counter_file${counter_type:+ $counter_type}${counter_name:+ $counter_name}" >> "$CFGFILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -n "$pcre_options" ] && echo "pcre_options $pcre_options" >> "$CFGFILE"
|
||||||
|
|
||||||
|
# Both lists are order sensitive: 3proxy stops at the first match, so the
|
||||||
|
# exempting rules (nobandlimin and friends) have to be listed first.
|
||||||
|
config_list_foreach global pcre append_pcre
|
||||||
|
config_list_foreach global limit append_limit
|
||||||
|
|
||||||
|
config_list_foreach global include append_include
|
||||||
|
config_list_foreach global extra_config append_line
|
||||||
|
|
||||||
|
[ -n "$maxconn" ] && echo "maxconn $maxconn" >> "$CFGFILE"
|
||||||
|
|
||||||
|
config_foreach append_service service
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
local enabled
|
||||||
|
|
||||||
|
config_load 3proxy
|
||||||
|
config_get_bool enabled global enabled 0
|
||||||
|
|
||||||
|
[ "$enabled" -gt 0 ] || {
|
||||||
|
echo "3proxy is disabled in /etc/config/3proxy" >&2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
write_config
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG" "$CFGFILE"
|
||||||
|
procd_set_param file "$CFGFILE"
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_set_param stdout 1
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
procd_add_reload_trigger "3proxy"
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
Name: 3proxy
|
Name: 3proxy
|
||||||
Version: 1.0.0
|
Version: 0.9.9.3
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: 3proxy tiny proxy server
|
Summary: 3proxy tiny proxy server
|
||||||
License: GPL/LGPL/Apache/BSD
|
License: GPL/LGPL/Apache/BSD
|
||||||
|
|||||||
+5
-1
@@ -511,6 +511,11 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
/* before readconfig() starts the services: a client gone while it is
|
||||||
|
written to is an error, not the end */
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
#endif
|
||||||
_3proxy_mutex_init(&config_mutex);
|
_3proxy_mutex_init(&config_mutex);
|
||||||
_3proxy_mutex_init(&bandlim_mutex);
|
_3proxy_mutex_init(&bandlim_mutex);
|
||||||
_3proxy_mutex_init(&connlim_mutex);
|
_3proxy_mutex_init(&connlim_mutex);
|
||||||
@@ -561,7 +566,6 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int
|
|||||||
signal(SIGCONT, mysigpause);
|
signal(SIGCONT, mysigpause);
|
||||||
signal(SIGTERM, mysigterm);
|
signal(SIGTERM, mysigterm);
|
||||||
signal(SIGUSR1, mysigusr1);
|
signal(SIGUSR1, mysigusr1);
|
||||||
signal(SIGPIPE, SIG_IGN);
|
|
||||||
cyclestep();
|
cyclestep();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+23
-4
@@ -198,12 +198,20 @@ static int calc_replydigest(char *packet, char *original, const char *secret, in
|
|||||||
int secretlen;
|
int secretlen;
|
||||||
uint8_t calc_digest[AUTH_VECTOR_LEN];
|
uint8_t calc_digest[AUTH_VECTOR_LEN];
|
||||||
uint8_t calc_vector[AUTH_VECTOR_LEN];
|
uint8_t calc_vector[AUTH_VECTOR_LEN];
|
||||||
|
unsigned int dlen = AUTH_VECTOR_LEN;
|
||||||
|
mdh_ctx *ctx;
|
||||||
|
|
||||||
memcpy(calc_vector, packet + 4, AUTH_VECTOR_LEN);
|
memcpy(calc_vector, packet + 4, AUTH_VECTOR_LEN);
|
||||||
memcpy(packet + 4, original, AUTH_VECTOR_LEN);
|
memcpy(packet + 4, original, AUTH_VECTOR_LEN);
|
||||||
secretlen = strlen(secret);
|
secretlen = strlen(secret);
|
||||||
memcpy(packet + len, secret, secretlen);
|
/* hash the reply, then the secret: nothing is written past the reply */
|
||||||
md5_calc(calc_digest, (u_char *)packet, len + secretlen);
|
if(!(ctx = mdh_init(MDH_MD5, 16))) return 2;
|
||||||
|
if(!mdh_update(ctx, packet, len) || !mdh_update(ctx, secret, secretlen) ||
|
||||||
|
!mdh_final(ctx, calc_digest, &dlen)) {
|
||||||
|
mdh_free(ctx);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
mdh_free(ctx);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return 0 if OK, 2 if not OK.
|
* Return 0 if OK, 2 if not OK.
|
||||||
@@ -298,6 +306,7 @@ int radsend(struct clientparam * param, int auth, int stop){
|
|||||||
int total_length;
|
int total_length;
|
||||||
int len;
|
int len;
|
||||||
PROXYSOCKADDRTYPE saremote;
|
PROXYSOCKADDRTYPE saremote;
|
||||||
|
PROXYSOCKADDRTYPE safrom;
|
||||||
struct pollfd fds[1];
|
struct pollfd fds[1];
|
||||||
char vector[AUTH_VECTOR_LEN];
|
char vector[AUTH_VECTOR_LEN];
|
||||||
radius_packet_t packet, rpacket;
|
radius_packet_t packet, rpacket;
|
||||||
@@ -568,15 +577,25 @@ int radsend(struct clientparam * param, int auth, int stop){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
salen = sizeof(saremote);
|
salen = sizeof(safrom);
|
||||||
|
|
||||||
data_len = so._recvfrom(so.state, remsock, (char *)&rpacket, sizeof(packet)-16,
|
data_len = so._recvfrom(so.state, remsock, (char *)&rpacket, sizeof(packet)-16,
|
||||||
0, (struct sockaddr *)&saremote, &salen);
|
0, (struct sockaddr *)&safrom, &salen);
|
||||||
|
|
||||||
|
|
||||||
if (data_len < 20) {
|
if (data_len < 20) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* the reply must come from the server we asked */
|
||||||
|
if(*SAFAMILY(&safrom) != *SAFAMILY(&saremote) ||
|
||||||
|
memcmp(SAADDR(&safrom), SAADDR(&saremote), SAADDRLEN(&saremote)) ||
|
||||||
|
*SAPORT(&safrom) != *SAPORT(&saremote)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* and answer this request, and be of its own length */
|
||||||
|
if(data_len != ntohs(rpacket.length) || rpacket.id != packet.id) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if( auth && rpacket.code != PW_AUTHENTICATION_ACK &&
|
if( auth && rpacket.code != PW_AUTHENTICATION_ACK &&
|
||||||
rpacket.code != PW_AUTHENTICATION_REJECT ){
|
rpacket.code != PW_AUTHENTICATION_REJECT ){
|
||||||
|
|||||||
+92
-20
@@ -182,7 +182,7 @@ int timeouts[12] = {
|
|||||||
EINVAL below it and the thread silently gets the 8M system default stack.
|
EINVAL below it and the thread silently gets the 8M system default stack.
|
||||||
*/
|
*/
|
||||||
size_t threadstacksize(int extra){
|
size_t threadstacksize(int extra){
|
||||||
long size = BASESTACKSIZE + extra;
|
long size = BASESTACKSIZE + TLSSTACKSIZE + extra;
|
||||||
|
|
||||||
if(size < (long)PTHREAD_STACK_MIN) size = (long)PTHREAD_STACK_MIN;
|
if(size < (long)PTHREAD_STACK_MIN) size = (long)PTHREAD_STACK_MIN;
|
||||||
return (size_t)size;
|
return (size_t)size;
|
||||||
@@ -414,7 +414,6 @@ int
|
|||||||
return shutdown(s, how);
|
return shutdown(s, how);
|
||||||
}
|
}
|
||||||
int WINAPI def_closesocket(void* state, SOCKET s){
|
int WINAPI def_closesocket(void* state, SOCKET s){
|
||||||
usleep(SLEEPTIME);
|
|
||||||
return closesocket(s);
|
return closesocket(s);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -454,11 +453,18 @@ int
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* a peer gone is an error of the send, not SIGPIPE, where the system can
|
||||||
|
say so for a call: SIGPIPE is ignored too, for TLS and splice() */
|
||||||
|
#ifdef MSG_NOSIGNAL
|
||||||
|
#define SENDFLAGS MSG_NOSIGNAL
|
||||||
|
#else
|
||||||
|
#define SENDFLAGS 0
|
||||||
|
#endif
|
||||||
ssize_t def_send(void* state, SOCKET s, const void *msg, size_t len, int flags){
|
ssize_t def_send(void* state, SOCKET s, const void *msg, size_t len, int flags){
|
||||||
return send(s, msg, len, flags);
|
return send(s, msg, len, flags | SENDFLAGS);
|
||||||
}
|
}
|
||||||
ssize_t def_sendto(void* state, SOCKET s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen){
|
ssize_t def_sendto(void* state, SOCKET s, const void *msg, size_t len, int flags, const struct sockaddr *to, socklen_t tolen){
|
||||||
return sendto(s, msg, len, flags, to, tolen);
|
return sendto(s, msg, len, flags | SENDFLAGS, to, tolen);
|
||||||
}
|
}
|
||||||
ssize_t def_recv(void* state, SOCKET s, void *buf, size_t len, int flags){
|
ssize_t def_recv(void* state, SOCKET s, void *buf, size_t len, int flags){
|
||||||
return recv(s, buf, len, flags);
|
return recv(s, buf, len, flags);
|
||||||
@@ -655,6 +661,26 @@ int parseconnusername(char *username, struct clientparam *param, int extpasswd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* What waits for a socket waits in poll(): a call on it never does. */
|
||||||
|
void nonblock(SOCKET sock){
|
||||||
|
#ifdef _WIN32
|
||||||
|
unsigned long ul = 1;
|
||||||
|
ioctlsocket(sock, FIONBIO, &ul);
|
||||||
|
#else
|
||||||
|
fcntl(sock, F_SETFL, O_NONBLOCK | fcntl(sock, F_GETFL));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* accept() with nothing to accept: another took it, or it was gone */
|
||||||
|
int acceptagain(void){
|
||||||
|
#ifdef _WIN32
|
||||||
|
int err = WSAGetLastError();
|
||||||
|
return err == WSAEWOULDBLOCK || err == WSAECONNRESET || err == WSAEINTR;
|
||||||
|
#else
|
||||||
|
return errno == EAGAIN || errno == EWOULDBLOCK || errno == ECONNABORTED || errno == EINTR;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa, SASIZETYPE size, int to){
|
int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa, SASIZETYPE size, int to){
|
||||||
struct pollfd fds[1];
|
struct pollfd fds[1];
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -677,6 +703,49 @@ int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* -Di / -De: ties a socket to the interface asked for, for TCP and UDP alike.
|
||||||
|
Where the option is set per protocol, family is the one of the address the
|
||||||
|
socket will be bound to. */
|
||||||
|
int bindtodevice(struct sockfuncs *sf, void *state, SOCKET sock, const char *device, int family){
|
||||||
|
if(!device) return 0;
|
||||||
|
#if defined SO_BINDTODEVICE
|
||||||
|
if(sf->_setsockopt(state, sock, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device) + 1))
|
||||||
|
return 1;
|
||||||
|
#elif defined IP_BOUND_IF
|
||||||
|
{
|
||||||
|
int idx;
|
||||||
|
idx = if_nametoindex(device);
|
||||||
|
if(!idx || (family == AF_INET && sf->_setsockopt(state, sock, IPPROTO_IP, IP_BOUND_IF, &idx, sizeof(idx))))
|
||||||
|
return 1;
|
||||||
|
#ifndef NOIPV6
|
||||||
|
#ifndef IPV6_BOUND_IF
|
||||||
|
#define IPV6_BOUND_IF 125
|
||||||
|
#endif
|
||||||
|
if(family == AF_INET6 && sf->_setsockopt(state, sock, IPPROTO_IPV6, IPV6_BOUND_IF, &idx, sizeof(idx))) return 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the external side, a socket to be bound to sinsl */
|
||||||
|
int extbindtodevice(struct clientparam *param, SOCKET sock){
|
||||||
|
#if defined SO_BINDTODEVICE || defined IP_BOUND_IF
|
||||||
|
return bindtodevice(¶m->srv->so, param->sostate, sock, param->srv->obindtodevice, *SAFAMILY(¶m->sinsl));
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the internal side, a socket to be bound to sincl */
|
||||||
|
int intbindtodevice(struct clientparam *param, SOCKET sock){
|
||||||
|
#if defined SO_BINDTODEVICE || defined IP_BOUND_IF
|
||||||
|
return bindtodevice(¶m->srv->so, param->sostate, sock, param->srv->ibindtodevice, *SAFAMILY(¶m->sincl));
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int doconnect(struct clientparam * param){
|
int doconnect(struct clientparam * param){
|
||||||
SASIZETYPE size;
|
SASIZETYPE size;
|
||||||
|
|
||||||
@@ -693,7 +762,9 @@ int doconnect(struct clientparam * param){
|
|||||||
if(param->srv->so._getpeername(param->sostate, param->remsock, (struct sockaddr *)¶m->sinsr, &size)==-1) {return (14);}
|
if(param->srv->so._getpeername(param->sostate, param->remsock, (struct sockaddr *)¶m->sinsr, &size)==-1) {return (14);}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#ifndef _WIN32
|
||||||
struct linger lg = {1,conf.timeouts[LINGER_TO]};
|
struct linger lg = {1,conf.timeouts[LINGER_TO]};
|
||||||
|
#endif
|
||||||
|
|
||||||
if(SAISNULL(¶m->sinsr)){
|
if(SAISNULL(¶m->sinsr)){
|
||||||
if(SAISNULL(¶m->req)) {
|
if(SAISNULL(¶m->req)) {
|
||||||
@@ -723,24 +794,25 @@ int doconnect(struct clientparam * param){
|
|||||||
*SAPORT(¶m->sinsl) = 0;
|
*SAPORT(¶m->sinsl) = 0;
|
||||||
setopts(param->remsock, param->srv->srvsockopts);
|
setopts(param->remsock, param->srv->srvsockopts);
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
/* not on Windows, see the accepting side in proxymain.c */
|
||||||
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
||||||
#if defined SO_BINDTODEVICE
|
|
||||||
if(param->srv->obindtodevice) {
|
|
||||||
if(param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_BINDTODEVICE, param->srv->obindtodevice, strlen(param->srv->obindtodevice) + 1))
|
|
||||||
return 12;
|
|
||||||
}
|
|
||||||
#elif defined IP_BOUND_IF
|
|
||||||
if(param->srv->obindtodevice) {
|
|
||||||
int idx;
|
|
||||||
idx = if_nametoindex(param->srv->obindtodevice);
|
|
||||||
if(!idx || (*SAFAMILY(¶m->sinsl) == AF_INET && param->srv->so._setsockopt(param->sostate, param->remsock, IPPROTO_IP, IP_BOUND_IF, &idx, sizeof(idx))))
|
|
||||||
return 12;
|
|
||||||
#ifndef NOIPV6
|
|
||||||
#ifndef IPV6_BOUND_IF
|
|
||||||
#define IPV6_BOUND_IF 125
|
|
||||||
#endif
|
|
||||||
if(*SAFAMILY(¶m->sinsl) == AF_INET6 && param->srv->so._setsockopt(param->sostate, param->remsock, IPPROTO_IPV6, IPV6_BOUND_IF, &idx, sizeof(idx))) return 12;
|
|
||||||
#endif
|
#endif
|
||||||
|
if(extbindtodevice(param, param->remsock)) return 12;
|
||||||
|
#ifdef IP_BIND_ADDRESS_NO_PORT
|
||||||
|
/* A port the kernel chooses is chosen by connect(), for the pair with
|
||||||
|
the destination: one in use towards another destination, or closing
|
||||||
|
from an earlier connection, does as well. bind() would take one of
|
||||||
|
its own, and with many connections find none left, or search long
|
||||||
|
for it. */
|
||||||
|
if((param->operation >= 256 || (param->operation & CONNECT) || param->redirected)
|
||||||
|
# ifdef WITH_UN
|
||||||
|
&& *SAFAMILY(¶m->sinsl) != AF_UNIX
|
||||||
|
# endif
|
||||||
|
){
|
||||||
|
int one = 1;
|
||||||
|
|
||||||
|
param->srv->so._setsockopt(param->sostate, param->remsock, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, (char *)&one, sizeof(one));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_UN
|
#ifdef WITH_UN
|
||||||
|
|||||||
+30
-7
@@ -158,7 +158,12 @@ int start_proxy_thread(struct child * chp){
|
|||||||
pthread_attr_init(&pa);
|
pthread_attr_init(&pa);
|
||||||
pthread_attr_setstacksize(&pa,threadstacksize(conf.stacksize));
|
pthread_attr_setstacksize(&pa,threadstacksize(conf.stacksize));
|
||||||
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
||||||
pthread_create(&thread, &pa, startsrv, (void *)chp);
|
if(pthread_create(&thread, &pa, startsrv, (void *)chp)){
|
||||||
|
pthread_attr_destroy(&pa);
|
||||||
|
fprintf(stderr, "Failed to create service thread on line %d, try to set larger stacksize\n", linenum);
|
||||||
|
_3proxy_sem_unlock(conf.threadinit);
|
||||||
|
return(40);
|
||||||
|
}
|
||||||
pthread_attr_destroy(&pa);
|
pthread_attr_destroy(&pa);
|
||||||
#endif
|
#endif
|
||||||
_3proxy_sem_lock(conf.threadinit);
|
_3proxy_sem_lock(conf.threadinit);
|
||||||
@@ -331,7 +336,8 @@ static int h_log(int argc, unsigned char ** argv){
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
conf.logfunc = logsyslog;
|
conf.logfunc = logsyslog;
|
||||||
if(notchanged) return 0;
|
if(notchanged) return 0;
|
||||||
openlog((char *)conf.logtarget+1, LOG_PID, LOG_DAEMON);
|
/* connected now: after a chroot there is no /dev/log to find */
|
||||||
|
openlog((char *)conf.logtarget+1, LOG_PID | LOG_NDELAY, LOG_DAEMON);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef WITH_ODBC
|
#ifdef WITH_ODBC
|
||||||
@@ -1591,6 +1597,14 @@ static int h_setgid(int argc, unsigned char **argv){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* What the C library reads on first use from files a chroot hides, read
|
||||||
|
while they can still be found: the time zone, without which every time
|
||||||
|
is UTC. Names looked up through the system cannot be helped this way, the
|
||||||
|
hosts file and resolv.conf are read again for lookups to come. */
|
||||||
|
static void prechroot(void){
|
||||||
|
tzset();
|
||||||
|
}
|
||||||
|
|
||||||
static int h_chroot(int argc, unsigned char **argv){
|
static int h_chroot(int argc, unsigned char **argv){
|
||||||
uid_t uid = 0;
|
uid_t uid = 0;
|
||||||
gid_t gid = 0;
|
gid_t gid = 0;
|
||||||
@@ -1610,6 +1624,8 @@ static int h_chroot(int argc, unsigned char **argv){
|
|||||||
}
|
}
|
||||||
if(!chrootp){
|
if(!chrootp){
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
prechroot();
|
||||||
if(chroot((char *)argv[1])) {
|
if(chroot((char *)argv[1])) {
|
||||||
fprintf(stderr, "Unable to chroot %s", argv[1]);
|
fprintf(stderr, "Unable to chroot %s", argv[1]);
|
||||||
return(1);
|
return(1);
|
||||||
@@ -1920,6 +1936,7 @@ int readconfig(FILE * fp){
|
|||||||
|
|
||||||
if( !(buf = malloc(bufsize)) || ! (argv = malloc((NPARAMS + 1) * sizeof(unsigned char *))) ) {
|
if( !(buf = malloc(bufsize)) || ! (argv = malloc((NPARAMS + 1) * sizeof(unsigned char *))) ) {
|
||||||
fprintf(stderr, "No memory for configuration");
|
fprintf(stderr, "No memory for configuration");
|
||||||
|
if(buf) free(buf);
|
||||||
return(10);
|
return(10);
|
||||||
}
|
}
|
||||||
for (linenum = 1; fgets((char *)buf, STRINGBUF, fp); linenum++){
|
for (linenum = 1; fgets((char *)buf, STRINGBUF, fp); linenum++){
|
||||||
@@ -1929,7 +1946,8 @@ int readconfig(FILE * fp){
|
|||||||
argc = parsestr (buf, argv, NPARAMS-1, &buf, &inbuf, &bufsize);
|
argc = parsestr (buf, argv, NPARAMS-1, &buf, &inbuf, &bufsize);
|
||||||
if(argc < 1) {
|
if(argc < 1) {
|
||||||
fprintf(stderr, "Parse error line %d\n", linenum);
|
fprintf(stderr, "Parse error line %d\n", linenum);
|
||||||
return(11);
|
res = 11;
|
||||||
|
goto DONE;
|
||||||
}
|
}
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
if(!strcmp((char *)argv[0], "end") && argc == 1) {
|
if(!strcmp((char *)argv[0], "end") && argc == 1) {
|
||||||
@@ -1951,23 +1969,28 @@ int readconfig(FILE * fp){
|
|||||||
if(!strcmp((char *)argv[0], (char *)cm->command)){
|
if(!strcmp((char *)argv[0], (char *)cm->command)){
|
||||||
if(argc < cm->minargs || (cm->maxargs && argc > cm->maxargs)){
|
if(argc < cm->minargs || (cm->maxargs && argc > cm->maxargs)){
|
||||||
fprintf(stderr, "Command: '%s' wrong number of arguments , line %d\n", argv[0], linenum);
|
fprintf(stderr, "Command: '%s' wrong number of arguments , line %d\n", argv[0], linenum);
|
||||||
return(linenum);
|
res = linenum;
|
||||||
|
goto DONE;
|
||||||
}
|
}
|
||||||
res = (*cm->handler)(argc, argv);
|
res = (*cm->handler)(argc, argv);
|
||||||
if(res > 0){
|
if(res > 0){
|
||||||
fprintf(stderr, "Command: '%s' failed with code %d, line %d\n", argv[0], res, linenum);
|
fprintf(stderr, "Command: '%s' failed with code %d, line %d\n", argv[0], res, linenum);
|
||||||
return(linenum);
|
res = linenum;
|
||||||
|
goto DONE;
|
||||||
}
|
}
|
||||||
if(!res) break;
|
if(!res) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(res != 1)continue;
|
if(res != 1)continue;
|
||||||
fprintf(stderr, "Unknown command: '%s' line %d\n", argv[0], linenum);
|
fprintf(stderr, "Unknown command: '%s' line %d\n", argv[0], linenum);
|
||||||
return(linenum);
|
res = linenum;
|
||||||
|
goto DONE;
|
||||||
}
|
}
|
||||||
|
res = 0;
|
||||||
|
DONE:
|
||||||
free(buf);
|
free(buf);
|
||||||
free(argv);
|
free(argv);
|
||||||
return 0;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+38
-3
@@ -15,6 +15,12 @@
|
|||||||
|
|
||||||
#define BUFSIZE 16384
|
#define BUFSIZE 16384
|
||||||
|
|
||||||
|
/* An answer to the query asked: our id, a response, and the question
|
||||||
|
byte for byte. */
|
||||||
|
static int dnsanswer(const unsigned char *buf, int len, const unsigned char *q, int qend){
|
||||||
|
return len >= qend && buf[0] == q[0] && buf[1] == q[1] && (buf[2] & 0x80) &&
|
||||||
|
buf[4] == q[4] && buf[5] == q[5] && !memcmp(buf + 12, q + 12, qend - 12);
|
||||||
|
}
|
||||||
|
|
||||||
void * dnsprchild(struct clientparam* param) {
|
void * dnsprchild(struct clientparam* param) {
|
||||||
uint32_t ip = 0;
|
uint32_t ip = 0;
|
||||||
@@ -144,6 +150,20 @@ void * dnsprchild(struct clientparam* param) {
|
|||||||
else ip = 0;
|
else ip = 0;
|
||||||
}
|
}
|
||||||
if(!ip && numservers){
|
if(!ip && numservers){
|
||||||
|
/* the question, to check the answer against; the name server is
|
||||||
|
asked under an id of our own, the client's put back in its answer */
|
||||||
|
unsigned char question[1024], cid[2];
|
||||||
|
int qend = (len < i)? len : i;
|
||||||
|
unsigned short id = (unsigned short)myrand();
|
||||||
|
PROXYSOCKADDRTYPE from;
|
||||||
|
time_t deadline;
|
||||||
|
int to;
|
||||||
|
|
||||||
|
cid[0] = buf[0];
|
||||||
|
cid[1] = buf[1];
|
||||||
|
buf[0] = (unsigned char)(id >> 8);
|
||||||
|
buf[1] = (unsigned char)(id & 0xff);
|
||||||
|
memcpy(question, buf, qend);
|
||||||
if((param->remsock=param->srv->so._socket(param->sostate, SASOCK(&nservers[0].addr), nservers[0].usetcp? SOCK_STREAM:SOCK_DGRAM, nservers[0].usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {
|
if((param->remsock=param->srv->so._socket(param->sostate, SASOCK(&nservers[0].addr), nservers[0].usetcp? SOCK_STREAM:SOCK_DGRAM, nservers[0].usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {
|
||||||
RETURN(818);
|
RETURN(818);
|
||||||
}
|
}
|
||||||
@@ -172,9 +192,21 @@ void * dnsprchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
param->statscli64 += i;
|
param->statscli64 += i;
|
||||||
param->nwrites++;
|
param->nwrites++;
|
||||||
len = sockrecvfrom(param, param->remsock, (struct sockaddr *)¶m->sinsr, buf, BUFSIZE, conf.timeouts[DNS_TO]*1000);
|
/* over UDP only an answer from the name server asked is taken, any
|
||||||
if(len <= 13) {
|
other read past while the time for it lasts */
|
||||||
RETURN(821);
|
deadline = time(NULL) + conf.timeouts[DNS_TO];
|
||||||
|
for(;;){
|
||||||
|
to = (int)(deadline - time(NULL));
|
||||||
|
if(to <= 0) RETURN(821);
|
||||||
|
len = sockrecvfrom(param, param->remsock, (struct sockaddr *)&from, buf, BUFSIZE, to*1000);
|
||||||
|
if(len <= 13) {
|
||||||
|
RETURN(821);
|
||||||
|
}
|
||||||
|
if(nservers[0].usetcp) break;
|
||||||
|
if(*SAFAMILY(&from) == *SAFAMILY(¶m->sinsr) &&
|
||||||
|
!memcmp(SAADDR(&from), SAADDR(¶m->sinsr), SAADDRLEN(¶m->sinsr)) &&
|
||||||
|
*SAPORT(&from) == *SAPORT(¶m->sinsr) &&
|
||||||
|
dnsanswer(buf, len, question, qend)) break;
|
||||||
}
|
}
|
||||||
param->statssrv64 += len;
|
param->statssrv64 += len;
|
||||||
param->nreads++;
|
param->nreads++;
|
||||||
@@ -186,7 +218,10 @@ void * dnsprchild(struct clientparam* param) {
|
|||||||
len -= 2;
|
len -= 2;
|
||||||
if(len < us) len += sockgetlinebuf(param, SERVER, buf+len, us - len, 0, conf.timeouts[SINGLEBYTE_L]);
|
if(len < us) len += sockgetlinebuf(param, SERVER, buf+len, us - len, 0, conf.timeouts[SINGLEBYTE_L]);
|
||||||
if(len != us) RETURN(832);
|
if(len != us) RETURN(832);
|
||||||
|
if(!dnsanswer(buf, len, question, qend)) RETURN(834);
|
||||||
}
|
}
|
||||||
|
buf[0] = cid[0];
|
||||||
|
buf[1] = cid[1];
|
||||||
if(buf[6] || buf[7]){
|
if(buf[6] || buf[7]){
|
||||||
if(socksendto(param, param->clisock, (struct sockaddr *)¶m->sincr, buf, len, conf.timeouts[SINGLEBYTE_L]*1000) != len){
|
if(socksendto(param, param->clisock, (struct sockaddr *)¶m->sincr, buf, len, conf.timeouts[SINGLEBYTE_L]*1000) != len){
|
||||||
RETURN(822);
|
RETURN(822);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ int ftplogin(struct clientparam *param, char *nbuf, int *innbuf) {
|
|||||||
if(i < 3) return 706;
|
if(i < 3) return 706;
|
||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
if(atoi(buf)/100 != 2) {
|
if(atoi(buf)/100 != 2) {
|
||||||
*innbuf = i;
|
if(innbuf)*innbuf = i;
|
||||||
return 702;
|
return 702;
|
||||||
}
|
}
|
||||||
sprintf(buf, "USER %.128s\r\n", param->extusername?param->extusername:(unsigned char *)"anonymous");
|
sprintf(buf, "USER %.128s\r\n", param->extusername?param->extusername:(unsigned char *)"anonymous");
|
||||||
@@ -75,6 +75,9 @@ int ftplogin(struct clientparam *param, char *nbuf, int *innbuf) {
|
|||||||
return 701;
|
return 701;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* USER answered at once, logged in (230) or refused: that answer is
|
||||||
|
the client's, waiting for one to its PASS */
|
||||||
|
else if(innbuf)*innbuf = i;
|
||||||
if(res != 2) {
|
if(res != 2) {
|
||||||
return 700;
|
return 700;
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-2
@@ -21,14 +21,18 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
SOCKET sc = INVALID_SOCKET, ss = INVALID_SOCKET, clidatasock = INVALID_SOCKET;
|
SOCKET sc = INVALID_SOCKET, ss = INVALID_SOCKET, clidatasock = INVALID_SOCKET;
|
||||||
SASIZETYPE sasize;
|
SASIZETYPE sasize;
|
||||||
char * req = NULL;
|
char * req = NULL;
|
||||||
|
#ifndef _WIN32
|
||||||
struct linger lg;
|
struct linger lg;
|
||||||
|
#endif
|
||||||
struct pollfd fds;
|
struct pollfd fds;
|
||||||
|
|
||||||
if(!(buf = malloc(BUFSIZE))) RETURN(876);
|
if(!(buf = malloc(BUFSIZE))) RETURN(876);
|
||||||
param->ctrlsock = param->clisock;
|
param->ctrlsock = param->clisock;
|
||||||
param->operation = CONNECT;
|
param->operation = CONNECT;
|
||||||
|
#ifndef _WIN32
|
||||||
lg.l_onoff = 1;
|
lg.l_onoff = 1;
|
||||||
lg.l_linger = conf.timeouts[STRING_L];;
|
lg.l_linger = conf.timeouts[STRING_L];
|
||||||
|
#endif
|
||||||
if(socksend(param, param->ctrlsock, (unsigned char *)"220 Ready\r\n", 11, conf.timeouts[STRING_S])!=11) {RETURN (801);}
|
if(socksend(param, param->ctrlsock, (unsigned char *)"220 Ready\r\n", 11, conf.timeouts[STRING_S])!=11) {RETURN (801);}
|
||||||
for(;;){
|
for(;;){
|
||||||
i = sockgetlinebuf(param, CLIENT, buf, BUFSIZE - 10, '\n', conf.timeouts[CONNECTION_S]);
|
i = sockgetlinebuf(param, CLIENT, buf, BUFSIZE - 10, '\n', conf.timeouts[CONNECTION_S]);
|
||||||
@@ -64,6 +68,13 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else if (!strncasecmp((char *)buf, "PASS ", 5)){
|
else if (!strncasecmp((char *)buf, "PASS ", 5)){
|
||||||
|
/* The user name carries the server to log in to, and it arrives
|
||||||
|
with USER. Without it there is nothing to log in to, and what
|
||||||
|
follows would read the name and the host as if there were. */
|
||||||
|
if(!param->hostname || !param->extusername){
|
||||||
|
socksend(param, param->ctrlsock, (unsigned char *)"503 Login with USER first\r\n", 27, conf.timeouts[STRING_S]);
|
||||||
|
RETURN(805);
|
||||||
|
}
|
||||||
param->extpassword = (unsigned char *)strdup((char *)buf+5);
|
param->extpassword = (unsigned char *)strdup((char *)buf+5);
|
||||||
inbuf = BUFSIZE;
|
inbuf = BUFSIZE;
|
||||||
res = ftplogin(param, (char *)buf, &inbuf);
|
res = ftplogin(param, (char *)buf, &inbuf);
|
||||||
@@ -119,7 +130,8 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
param->srv->so._closesocket(param->sostate, clidatasock);
|
param->srv->so._closesocket(param->sostate, clidatasock);
|
||||||
clidatasock = INVALID_SOCKET;
|
clidatasock = INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
if ((clidatasock=socket(SASOCK(¶m->sincl), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
|
if ((clidatasock=param->srv->so._socket(param->sostate, SASOCK(¶m->sincl), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
|
||||||
|
if(intbindtodevice(param, clidatasock)){RETURN(822);}
|
||||||
*SAPORT(¶m->sincl) = 0;
|
*SAPORT(¶m->sincl) = 0;
|
||||||
if(param->srv->so._bind(param->sostate, clidatasock, (struct sockaddr *)¶m->sincl, SASIZE(¶m->sincl))){RETURN(822);}
|
if(param->srv->so._bind(param->sostate, clidatasock, (struct sockaddr *)¶m->sincl, SASIZE(¶m->sincl))){RETURN(822);}
|
||||||
if (pasv) {
|
if (pasv) {
|
||||||
@@ -252,8 +264,11 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
sc = param->remsock;
|
sc = param->remsock;
|
||||||
param->remsock = ss;
|
param->remsock = ss;
|
||||||
|
#ifndef _WIN32
|
||||||
|
/* not on Windows, see the accepting side in proxymain.c */
|
||||||
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
param->srv->so._setsockopt(param->sostate, param->remsock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
||||||
param->srv->so._setsockopt(param->sostate, clidatasock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
param->srv->so._setsockopt(param->sostate, clidatasock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
||||||
|
#endif
|
||||||
param->clisock = clidatasock;
|
param->clisock = clidatasock;
|
||||||
res = mapsocket(param, conf.timeouts[CONNECTION_S]);
|
res = mapsocket(param, conf.timeouts[CONNECTION_S]);
|
||||||
if(param->remsock != INVALID_SOCKET) {
|
if(param->remsock != INVALID_SOCKET) {
|
||||||
|
|||||||
+56
-13
@@ -220,6 +220,14 @@ struct pcre_filter_data {
|
|||||||
struct ace *acl;
|
struct ace *acl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* What a connection matches with: pcre2_match() writes into its match
|
||||||
|
data, so a thread matching on the rule's own one would race every
|
||||||
|
other thread doing the same. */
|
||||||
|
struct pcre_client_data {
|
||||||
|
struct pcre_filter_data *pcrefd;
|
||||||
|
pcre2_match_data * match_data;
|
||||||
|
};
|
||||||
|
|
||||||
static void pcre_data_free(struct pcre_filter_data *pcrefd){
|
static void pcre_data_free(struct pcre_filter_data *pcrefd){
|
||||||
_3proxy_mutex_lock(&pcre_mutex);
|
_3proxy_mutex_lock(&pcre_mutex);
|
||||||
pcrefd->users--;
|
pcrefd->users--;
|
||||||
@@ -253,18 +261,35 @@ static void* pcre_filter_open(void * idata, struct srvparam * param){
|
|||||||
static FILTER_ACTION pcre_filter_client(void *fo, struct clientparam * param, void** fc){
|
static FILTER_ACTION pcre_filter_client(void *fo, struct clientparam * param, void** fc){
|
||||||
int res;
|
int res;
|
||||||
struct ace tmpace;
|
struct ace tmpace;
|
||||||
|
struct pcre_filter_data *rule = (struct pcre_filter_data *)fo;
|
||||||
|
struct pcre_client_data *pcd;
|
||||||
|
|
||||||
*fc = fo;
|
*fc = fo;
|
||||||
if(!fo) return PASS;
|
if(!fo) return PASS;
|
||||||
#define pcrefd ((struct pcre_filter_data *)fo)
|
if(!rule->acl) return CONTINUE;
|
||||||
if(!pcrefd->acl) return CONTINUE;
|
|
||||||
memset (&tmpace, 0, sizeof(struct ace));
|
memset (&tmpace, 0, sizeof(struct ace));
|
||||||
tmpace.src = pcrefd->acl->src;
|
tmpace.src = rule->acl->src;
|
||||||
res = pl->ACLMatches(&tmpace, param);
|
res = pl->ACLMatches(&tmpace, param);
|
||||||
#undef pcrefd
|
if(!res) return PASS;
|
||||||
return (res)? CONTINUE:PASS;
|
/* the connection goes on with a match data of its own */
|
||||||
|
if(!(pcd = pl->mallocfunc(sizeof(struct pcre_client_data)))){
|
||||||
|
*fc = NULL;
|
||||||
|
return rule->action;
|
||||||
|
}
|
||||||
|
pcd->pcrefd = rule;
|
||||||
|
pcd->match_data = NULL;
|
||||||
|
if(rule->re && !(pcd->match_data = pcre2_match_data_create_from_pattern(rule->re, NULL))){
|
||||||
|
pl->freefunc(pcd);
|
||||||
|
*fc = NULL;
|
||||||
|
return rule->action;
|
||||||
|
}
|
||||||
|
*fc = pcd;
|
||||||
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* What a rewritten buffer keeps free for its caller to append to. */
|
||||||
|
#define PCRE_HEADROOM 1024
|
||||||
|
|
||||||
static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p){
|
static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p){
|
||||||
PCRE2_SIZE *ovector;
|
PCRE2_SIZE *ovector;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -274,10 +299,11 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
char * replace;
|
char * replace;
|
||||||
char * tmpbuf, *target, *newbuf;
|
char * tmpbuf, *target, *newbuf;
|
||||||
int nreplaces=0;
|
int nreplaces=0;
|
||||||
#define pcrefd ((struct pcre_filter_data *)fc)
|
struct pcre_client_data *pcd = (struct pcre_client_data *)fc;
|
||||||
|
#define pcrefd (pcd->pcrefd)
|
||||||
|
|
||||||
for(acl = pcrefd->acl; acl; acl=acl->next){
|
for(acl = pcrefd->acl; acl; acl=acl->next){
|
||||||
if(pl->ACLMatches(pcrefd->acl, param)){
|
if(pl->ACLMatches(acl, param)){
|
||||||
match = 1;
|
match = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -287,9 +313,9 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
for(; offset < *length_p; nreplaces++){
|
for(; offset < *length_p; nreplaces++){
|
||||||
int repsz;
|
int repsz;
|
||||||
|
|
||||||
count = pcre2_match(pcrefd->re, (PCRE2_SPTR)*buf_p, *length_p, offset, 0, pcrefd->match_data, pcrefd->match_context);
|
count = pcre2_match(pcrefd->re, (PCRE2_SPTR)*buf_p, *length_p, offset, 0, pcd->match_data, pcrefd->match_context);
|
||||||
if(count <= 0) break;
|
if(count <= 0) break;
|
||||||
ovector = pcre2_get_ovector_pointer(pcrefd->match_data);
|
ovector = pcre2_get_ovector_pointer(pcd->match_data);
|
||||||
if(ovector[0] > (PCRE2_SIZE)*length_p || ovector[1] > (PCRE2_SIZE)*length_p || ovector[1] < ovector[0]) break;
|
if(ovector[0] > (PCRE2_SIZE)*length_p || ovector[1] > (PCRE2_SIZE)*length_p || ovector[1] < ovector[0]) break;
|
||||||
if(!(replace = pcrefd->replace) || param->nooverwritefilter) return pcrefd->action;
|
if(!(replace = pcrefd->replace) || param->nooverwritefilter) return pcrefd->action;
|
||||||
|
|
||||||
@@ -324,12 +350,17 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
else if(*replace == '$' && isnumber(*(replace+1))){
|
else if(*replace == '$' && isnumber(*(replace+1))){
|
||||||
replace ++;
|
replace ++;
|
||||||
num = atoi(replace);
|
num = atoi(replace);
|
||||||
|
/* Past the digits first, and only then decide whether
|
||||||
|
the group is one to copy: the pass which measured
|
||||||
|
this string did it in that order, and a reference it
|
||||||
|
counted as nothing must not be written out as its
|
||||||
|
own digits here. */
|
||||||
|
while(isnumber(*replace)) replace++;
|
||||||
if(num > (count - 1)) continue;
|
if(num > (count - 1)) continue;
|
||||||
if(ovector[(num<<1)] == PCRE2_UNSET) continue;
|
if(ovector[(num<<1)] == PCRE2_UNSET) continue;
|
||||||
if(ovector[(num<<1) + 1] > (PCRE2_SIZE)*length_p || ovector[(num<<1)] > ovector[(num<<1) + 1]) continue;
|
if(ovector[(num<<1) + 1] > (PCRE2_SIZE)*length_p || ovector[(num<<1)] > ovector[(num<<1) + 1]) continue;
|
||||||
memcpy(target, *buf_p + ovector[(num<<1)], ovector[(num<<1) + 1] - ovector[(num<<1)]);
|
memcpy(target, *buf_p + ovector[(num<<1)], ovector[(num<<1) + 1] - ovector[(num<<1)]);
|
||||||
target += (ovector[(num<<1) + 1] - ovector[(num<<1)]);
|
target += (ovector[(num<<1) + 1] - ovector[(num<<1)]);
|
||||||
while(isnumber(*replace)) replace++;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*target++ = *replace++;
|
*target++ = *replace++;
|
||||||
@@ -338,7 +369,13 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
repsz = (int)(target - tmpbuf);
|
repsz = (int)(target - tmpbuf);
|
||||||
memcpy(target, *buf_p + ovector[1], *length_p - ovector[1]);
|
memcpy(target, *buf_p + ovector[1], *length_p - ovector[1]);
|
||||||
if((ovector[0] + replen + 1) > *bufsize_p){
|
if((ovector[0] + replen + 1) > *bufsize_p){
|
||||||
newbuf = pl->mallocfunc(ovector[0] + replen + 1);
|
/* Room beyond what was produced: whoever asked for the
|
||||||
|
filtering usually has something of its own to add, and a
|
||||||
|
buffer sized to the last byte written leaves nowhere to
|
||||||
|
put it. The size reported is the size allocated. */
|
||||||
|
int newsize = ovector[0] + replen + 1 + PCRE_HEADROOM;
|
||||||
|
|
||||||
|
newbuf = pl->mallocfunc(newsize);
|
||||||
if(!newbuf){
|
if(!newbuf){
|
||||||
pl->freefunc(tmpbuf);
|
pl->freefunc(tmpbuf);
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
@@ -346,7 +383,7 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
memcpy(newbuf, *buf_p, ovector[0]);
|
memcpy(newbuf, *buf_p, ovector[0]);
|
||||||
pl->freefunc(*buf_p);
|
pl->freefunc(*buf_p);
|
||||||
*buf_p = (unsigned char *)newbuf;
|
*buf_p = (unsigned char *)newbuf;
|
||||||
*bufsize_p = ovector[0] + replen + 1;
|
*bufsize_p = newsize;
|
||||||
}
|
}
|
||||||
memcpy(*buf_p + ovector[0], tmpbuf, replen);
|
memcpy(*buf_p + ovector[0], tmpbuf, replen);
|
||||||
pl->freefunc(tmpbuf);
|
pl->freefunc(tmpbuf);
|
||||||
@@ -362,7 +399,13 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
|
|||||||
#undef pcrefd
|
#undef pcrefd
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcre_filter_clear(void *fo){
|
static void pcre_filter_clear(void *fc){
|
||||||
|
struct pcre_client_data *pcd = (struct pcre_client_data *)fc;
|
||||||
|
|
||||||
|
if(pcd){
|
||||||
|
if(pcd->match_data) pcre2_match_data_free(pcd->match_data);
|
||||||
|
pl->freefunc(pcd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcre_filter_close(void *fo){
|
static void pcre_filter_close(void *fo){
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_SMTP_REQ:
|
case GOT_SMTP_REQ:
|
||||||
case GOT_SMTP_DATA:
|
case GOT_SMTP_DATA:
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate,fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
break;
|
break;
|
||||||
case GOT_HTTP_REQUEST:
|
case GOT_HTTP_REQUEST:
|
||||||
@@ -298,7 +298,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_HTTP_SRVDATA:
|
case GOT_HTTP_SRVDATA:
|
||||||
if(!fps->serversent){
|
if(!fps->serversent){
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[0], (int)strlen((char *)fp_stringtable[0]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fp_stringtable[0], (int)strlen((char *)fp_stringtable[0]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -306,7 +306,7 @@ void processcallbacks(struct fp_stream *fps, int what, char *msg, int size){
|
|||||||
case GOT_FTP_REQ:
|
case GOT_FTP_REQ:
|
||||||
case GOT_FTP_SRVDATA:
|
case GOT_FTP_SRVDATA:
|
||||||
fps->state = FLUSH_DATA;
|
fps->state = FLUSH_DATA;
|
||||||
pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->ctrlsock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
pl->socksend(NULL, fps->fpd.cp->ctrlsock, (unsigned char *)fp_stringtable[1], (int)strlen((char *)fp_stringtable[1]), pl->conf->timeouts[STRING_S]);
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -358,7 +358,7 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){
|
|||||||
if(fps->serversent >= fps->srvhdrwritten){
|
if(fps->serversent >= fps->srvhdrwritten){
|
||||||
sprintf(fps->buf, "%lx\r\n", len);
|
sprintf(fps->buf, "%lx\r\n", len);
|
||||||
sendchunk = (int)strlen(fps->buf);
|
sendchunk = (int)strlen(fps->buf);
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, fps->fpd.cp->clisock, (unsigned char *)fps->buf, sendchunk, pl->conf->timeouts[STRING_S]) != sendchunk){
|
if(pl->socksend(NULL, fps->fpd.cp->clisock, (unsigned char *)fps->buf, sendchunk, pl->conf->timeouts[STRING_S]) != sendchunk){
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -397,13 +397,13 @@ static int copyfdtosock(struct fp_stream * fps, DIRECTION which, long len){
|
|||||||
#endif
|
#endif
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)fps->buf, res, pl->conf->timeouts[STRING_S]) != res) {
|
if(pl->socksend(NULL, sock, (unsigned char *)fps->buf, res, pl->conf->timeouts[STRING_S]) != res) {
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
len -= res;
|
len -= res;
|
||||||
}
|
}
|
||||||
if(sendchunk){
|
if(sendchunk){
|
||||||
if(pl->socksend(fps->fpd.cp->sostate, sock, (unsigned char *)"\r\n", 2, pl->conf->timeouts[STRING_S]) != 2)
|
if(pl->socksend(NULL, sock, (unsigned char *)"\r\n", 2, pl->conf->timeouts[STRING_S]) != 2)
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
fps->state = state;
|
fps->state = state;
|
||||||
|
|||||||
@@ -61,14 +61,9 @@ char **load_string(FILE *f,int max_count_str, int *countloadstr,
|
|||||||
|
|
||||||
if (strstr(tmpbuf1,"[end]")==NULL)
|
if (strstr(tmpbuf1,"[end]")==NULL)
|
||||||
{
|
{
|
||||||
/* find and replace \n \r*/
|
/* the line's end cut off: what the file says with \n is what is
|
||||||
rstr = tmpbuf1;
|
sent */
|
||||||
while (*rstr!='\0')
|
tmpbuf1[strcspn(tmpbuf1, "\r\n")] = '\0';
|
||||||
{
|
|
||||||
if (*rstr=='\r' || *rstr=='\n' )
|
|
||||||
{ *rstr='\0'; rstr++; }
|
|
||||||
rstr++;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((rstr=strstr(tmpbuf1,"\\n")))
|
while ((rstr=strstr(tmpbuf1,"\\n")))
|
||||||
{
|
{
|
||||||
|
|||||||
+44
-2
@@ -132,6 +132,12 @@ char * proxy_stringtable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define LINESIZE 32768
|
#define LINESIZE 32768
|
||||||
|
/* "Content-Length: " plus 20 digits plus CRLF and a NUL, rounded up */
|
||||||
|
#define CLHDRSIZE 48
|
||||||
|
/* what the headers this proxy adds of its own can come to: a Forwarded or
|
||||||
|
Via with a host name in it, a Connection, a Proxy-support and a
|
||||||
|
Proxy-Authorization carrying an encoded user and password */
|
||||||
|
#define HDRRESERVE 2048
|
||||||
#define BUFSIZE (LINESIZE*2)
|
#define BUFSIZE (LINESIZE*2)
|
||||||
#define FTPBUFSIZE 1536
|
#define FTPBUFSIZE 1536
|
||||||
|
|
||||||
@@ -151,6 +157,34 @@ static int send_st(struct clientparam *param, int idx){
|
|||||||
return socksend(param, param->clisock, (unsigned char *)proxy_stringtable[idx], pst_len(idx), conf.timeouts[STRING_S]);
|
return socksend(param, param->clisock, (unsigned char *)proxy_stringtable[idx], pst_len(idx), conf.timeouts[STRING_S]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Makes room in a buffer whose size is tracked. A filter may hand back one
|
||||||
|
holding exactly what it produced, so nothing may be added to it without
|
||||||
|
asking for the room first. Returns 1 when the room cannot be had. */
|
||||||
|
static int growbuf(unsigned char **buf, int *bufsize, int need){
|
||||||
|
unsigned char *newbuf;
|
||||||
|
|
||||||
|
if(need <= *bufsize) return 0;
|
||||||
|
need += BUFSIZE; /* for what follows too, not just this */
|
||||||
|
if(!(newbuf = realloc(*buf, need))) return 1;
|
||||||
|
*buf = newbuf;
|
||||||
|
*bufsize = need;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Whether a request line names the host the previous one did, whatever its
|
||||||
|
method: the connection to the server is kept for the same host only, and
|
||||||
|
a POST after a GET to it is no reason to open another one. */
|
||||||
|
static int samehost(const unsigned char *line, int len, const unsigned char *host, int hostlen){
|
||||||
|
const unsigned char *p = (const unsigned char *)memchr(line, ' ', len);
|
||||||
|
|
||||||
|
if(!p || hostlen <= 0) return 0;
|
||||||
|
p++;
|
||||||
|
if(!strncasecmp((const char *)p, "http://", 7)) p += 7;
|
||||||
|
if((int)(p - line) + hostlen >= len || strncasecmp((const char *)p, (const char *)host, hostlen))
|
||||||
|
return 0;
|
||||||
|
return p[hostlen] == '/' || p[hostlen] == ' ';
|
||||||
|
}
|
||||||
|
|
||||||
static void freeptr(void *p){
|
static void freeptr(void *p){
|
||||||
void **pp = (void **)p;
|
void **pp = (void **)p;
|
||||||
if(*pp) { free(*pp); *pp = NULL; }
|
if(*pp) { free(*pp); *pp = NULL; }
|
||||||
@@ -245,7 +279,7 @@ void * proxychild(struct clientparam* param) {
|
|||||||
int clhdrofs_req = -1;
|
int clhdrofs_req = -1;
|
||||||
int isconnect = 0;
|
int isconnect = 0;
|
||||||
int redirect = 0;
|
int redirect = 0;
|
||||||
int prefix = 0, ckeepalive=0;
|
int prefix = 0, hostofs = 0, ckeepalive=0;
|
||||||
int ftp = 0;
|
int ftp = 0;
|
||||||
int ssoff = 0;
|
int ssoff = 0;
|
||||||
#ifndef ANONYMOUS
|
#ifndef ANONYMOUS
|
||||||
@@ -313,7 +347,7 @@ for(;;){
|
|||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
|
||||||
if(req) {
|
if(req) {
|
||||||
if(!param->transparent && !param->srv->transparent && (i<=prefix || strncasecmp((char *)buf, (char *)req, prefix))){
|
if(!param->transparent && !param->srv->transparent && !samehost(buf, i, req + hostofs, prefix - hostofs)){
|
||||||
ckeepalive = 0;
|
ckeepalive = 0;
|
||||||
if(param->remsock != INVALID_SOCKET){
|
if(param->remsock != INVALID_SOCKET){
|
||||||
param->srv->so._shutdown(param->sostate, param->remsock, SHUT_RDWR);
|
param->srv->so._shutdown(param->sostate, param->remsock, SHUT_RDWR);
|
||||||
@@ -368,6 +402,7 @@ for(;;){
|
|||||||
*se = 0;
|
*se = 0;
|
||||||
}
|
}
|
||||||
prefix = (int)(se - buf);
|
prefix = (int)(se - buf);
|
||||||
|
hostofs = (int)(sb - buf);
|
||||||
su = (unsigned char*)strrchr((char *)sb, '@');
|
su = (unsigned char*)strrchr((char *)sb, '@');
|
||||||
if(su) {
|
if(su) {
|
||||||
su = (unsigned char *)strdup((char *)sb);
|
su = (unsigned char *)strdup((char *)sb);
|
||||||
@@ -587,6 +622,10 @@ for(;;){
|
|||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
if(action != PASS) RETURN(517);
|
if(action != PASS) RETURN(517);
|
||||||
|
/* A filter may have returned a buffer sized to exactly what it produced.
|
||||||
|
The headers this proxy adds of its own go in after it, so the room for
|
||||||
|
them is taken back before anything is written. */
|
||||||
|
if(growbuf(&buf, &bufsize, inbuf + HDRRESERVE)) RETURN(21);
|
||||||
param->nolongdatfilter = 0;
|
param->nolongdatfilter = 0;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -620,6 +659,7 @@ for(;;){
|
|||||||
contentlength64 = param->cliinbuf;
|
contentlength64 = param->cliinbuf;
|
||||||
param->nolongdatfilter = 1;
|
param->nolongdatfilter = 1;
|
||||||
}
|
}
|
||||||
|
if(growbuf(&buf, &bufsize, (int)strlen((char *)buf) + CLHDRSIZE)) RETURN(21);
|
||||||
sprintf((char*)buf+strlen((char *)buf), "Content-Length: %"PRIu64"\r\n", contentlength64);
|
sprintf((char*)buf+strlen((char *)buf), "Content-Length: %"PRIu64"\r\n", contentlength64);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1097,6 +1137,7 @@ for(;;){
|
|||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
if(action != PASS) RETURN(517);
|
if(action != PASS) RETURN(517);
|
||||||
|
if(growbuf(&buf, &bufsize, inbuf + HDRRESERVE)) RETURN(21);
|
||||||
|
|
||||||
param->nolongdatfilter = 0;
|
param->nolongdatfilter = 0;
|
||||||
|
|
||||||
@@ -1120,6 +1161,7 @@ for(;;){
|
|||||||
}
|
}
|
||||||
if(action != PASS) RETURN(517);
|
if(action != PASS) RETURN(517);
|
||||||
contentlength64 = param->srvinbuf;
|
contentlength64 = param->srvinbuf;
|
||||||
|
if(growbuf(&buf, &bufsize, (int)strlen((char *)buf) + CLHDRSIZE)) RETURN(21);
|
||||||
sprintf((char*)buf+strlen((char *)buf), "Content-Length: %"PRIu64"\r\n", contentlength64);
|
sprintf((char*)buf+strlen((char *)buf), "Content-Length: %"PRIu64"\r\n", contentlength64);
|
||||||
hascontent = 1;
|
hascontent = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-1
@@ -135,6 +135,23 @@ void daemonize(void);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* wolfSSL reserves around 48K of static thread-local storage. glibc counts
|
||||||
|
that against the thread stack, so pthread_create() fails with EINVAL and
|
||||||
|
no thread starts at all. musl places the block next to the stack instead
|
||||||
|
of inside it and needs nothing extra, and OpenSSL has no static TLS.
|
||||||
|
musl identifies itself by no macro of its own, but it does not define
|
||||||
|
__GLIBC__, which any libc header pulled in above would have set.
|
||||||
|
*/
|
||||||
|
#ifndef TLSSTACKSIZE
|
||||||
|
#if defined(__linux__) && !defined(__GLIBC__)
|
||||||
|
#define TLSSTACKSIZE 0
|
||||||
|
#elif defined(WITH_WOLFSSL)
|
||||||
|
#define TLSSTACKSIZE 49152
|
||||||
|
#else
|
||||||
|
#define TLSSTACKSIZE 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
size_t threadstacksize(int extra);
|
size_t threadstacksize(int extra);
|
||||||
#endif
|
#endif
|
||||||
@@ -154,7 +171,8 @@ size_t threadstacksize(int extra);
|
|||||||
#ifndef strncasecmp
|
#ifndef strncasecmp
|
||||||
#define strncasecmp strnicmp
|
#define strncasecmp strnicmp
|
||||||
#endif
|
#endif
|
||||||
#define seterrno3(x) _set_errno(x)
|
/* errno is WSAGetLastError() here */
|
||||||
|
#define seterrno3(x) WSASetLastError(x)
|
||||||
#else
|
#else
|
||||||
#define seterrno3(x) (errno = x)
|
#define seterrno3(x) (errno = x)
|
||||||
#endif
|
#endif
|
||||||
@@ -352,6 +370,11 @@ unsigned char * dologname (unsigned char *buf, unsigned char *name, const unsign
|
|||||||
int readconfig(FILE * fp);
|
int readconfig(FILE * fp);
|
||||||
void initcommands(void);
|
void initcommands(void);
|
||||||
int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa, SASIZETYPE size, int to);
|
int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa, SASIZETYPE size, int to);
|
||||||
|
void nonblock(SOCKET sock);
|
||||||
|
int acceptagain(void);
|
||||||
|
int bindtodevice(struct sockfuncs *sf, void *state, SOCKET sock, const char *device, int family);
|
||||||
|
int extbindtodevice(struct clientparam *param, SOCKET sock);
|
||||||
|
int intbindtodevice(struct clientparam *param, SOCKET sock);
|
||||||
|
|
||||||
|
|
||||||
uint32_t myrand(void);
|
uint32_t myrand(void);
|
||||||
|
|||||||
+134
-41
@@ -7,6 +7,31 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
|
|
||||||
|
#ifdef WITH_UN
|
||||||
|
/* A service bound to a Unix socket path notes its file, as a service of a
|
||||||
|
newer configuration may bind the same path before this one closes: the
|
||||||
|
file is then the other's, which closing must not remove. */
|
||||||
|
static void unbound(struct srvparam *srv){
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if(*SAFAMILY(&srv->intsa) == AF_UNIX && *SAADDR(&srv->intsa) &&
|
||||||
|
!stat((char *)SAADDR(&srv->intsa), &st)){
|
||||||
|
srv->undev = (uint64_t)st.st_dev;
|
||||||
|
srv->unino = (uint64_t)st.st_ino;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ununlink(struct srvparam *srv){
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if(*SAFAMILY(&srv->intsa) == AF_UNIX && *SAADDR(&srv->intsa) &&
|
||||||
|
!stat((char *)SAADDR(&srv->intsa), &st) &&
|
||||||
|
(uint64_t)st.st_dev == srv->undev && (uint64_t)st.st_ino == srv->unino)
|
||||||
|
unlink((char *)SAADDR(&srv->intsa));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -63,6 +88,8 @@ void * threadfunc (void *p) {
|
|||||||
}
|
}
|
||||||
param->remsock = param->srv->so._accept(param->sostate, param->srv->cbsock, (struct sockaddr*)¶m->sinsr, &size);
|
param->remsock = param->srv->so._accept(param->sostate, param->srv->cbsock, (struct sockaddr*)¶m->sinsr, &size);
|
||||||
if(param->remsock == INVALID_SOCKET) {
|
if(param->remsock == INVALID_SOCKET) {
|
||||||
|
/* another client of the service took it: not a try */
|
||||||
|
if(acceptagain()) { i++; continue; }
|
||||||
dolog(param, (unsigned char *)"Connect back accept() failed");
|
dolog(param, (unsigned char *)"Connect back accept() failed");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -84,7 +111,7 @@ void * threadfunc (void *p) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(socksendto(param, param->remsock, (struct sockaddr*)¶m->sinsr, (unsigned char *)"C", 1, CONNBACK_TO*1000) != 1){
|
if(socksend(param, param->remsock, (unsigned char *)"C", 1, CONNBACK_TO) != 1){
|
||||||
dolog(param, (unsigned char *)"Connect back sending command failed");
|
dolog(param, (unsigned char *)"Connect back sending command failed");
|
||||||
param->srv->so._closesocket(param->sostate, param->remsock);
|
param->srv->so._closesocket(param->sostate, param->remsock);
|
||||||
param->remsock = INVALID_SOCKET;
|
param->remsock = INVALID_SOCKET;
|
||||||
@@ -306,7 +333,9 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
unsigned char *cbc_string = NULL, *cbl_string = NULL;
|
unsigned char *cbc_string = NULL, *cbl_string = NULL;
|
||||||
PROXYSOCKADDRTYPE cbsa;
|
PROXYSOCKADDRTYPE cbsa;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
|
#ifndef _WIN32
|
||||||
struct linger lg;
|
struct linger lg;
|
||||||
|
#endif
|
||||||
int nlog = 5000;
|
int nlog = 5000;
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
int saved_nsfd = -1;
|
int saved_nsfd = -1;
|
||||||
@@ -335,6 +364,8 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
" association: 1 - log, 2 - authorize, 3 - both (default), 0 (same as -U) -\n"
|
" association: 1 - log, 2 - authorize, 3 - both (default), 0 (same as -U) -\n"
|
||||||
" neither. The first destination is always authorized and logged\n"
|
" neither. The first destination is always authorized and logged\n"
|
||||||
#endif
|
#endif
|
||||||
|
" -B split the TLS ClientHello passed through tlspr at the SNI (DPI bypass),\n"
|
||||||
|
" with -ocTCP_NODELAY -osTCP_NODELAY\n"
|
||||||
"-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) - delay GRACE_DELAY milliseconds before polling if average polling size below GRACE_TRAFF bytes and GRACE_NUM read operations in single directions are detected within 1 second to minimize polling\n"
|
"-g(GRACE_TRAFF,GRACE_NUM,GRACE_DELAY) - delay GRACE_DELAY milliseconds before polling if average polling size below GRACE_TRAFF bytes and GRACE_NUM read operations in single directions are detected within 1 second to minimize polling\n"
|
||||||
" -fFORMAT logging format (see documentation)\n"
|
" -fFORMAT logging format (see documentation)\n"
|
||||||
" -l log to stderr\n"
|
" -l log to stderr\n"
|
||||||
@@ -391,6 +422,9 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
WSADATA wd;
|
WSADATA wd;
|
||||||
WSAStartup(MAKEWORD( 1, 1 ), &wd);
|
WSAStartup(MAKEWORD( 1, 1 ), &wd);
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* a client gone while it is written to is an error, not the end */
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -607,6 +641,13 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
case 'U':
|
case 'U':
|
||||||
srv.udpauth = *(argv[i]+2)? atoi(argv[i]+2) : 0;
|
srv.udpauth = *(argv[i]+2)? atoi(argv[i]+2) : 0;
|
||||||
break;
|
break;
|
||||||
|
case 'B':
|
||||||
|
/* the TLS ClientHello split at the SNI (tlspr), which -s is
|
||||||
|
where -s is not splice; s_option means something else
|
||||||
|
for these */
|
||||||
|
if(!isudp && srv.service != S_ADMIN)
|
||||||
|
srv.s_option = 1 + atoi(argv[i]+2);
|
||||||
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
#ifdef WITHSPLICE
|
#ifdef WITHSPLICE
|
||||||
if(isudp || srv.service == S_ADMIN)
|
if(isudp || srv.service == S_ADMIN)
|
||||||
@@ -685,7 +726,12 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
else {
|
else {
|
||||||
#endif
|
#endif
|
||||||
#ifndef NOPORTMAP
|
#ifndef NOPORTMAP
|
||||||
if (error || argc != i+3 || *argv[i]=='-'|| (*SAPORT(&srv.intsa) = htons((uint16_t)atoi(argv[i])))==0 || (srv.targetport = htons((uint16_t)atoi(argv[i+2])))==0) {
|
/* the port of a Unix socket target is ignored, 0 as the manual has it */
|
||||||
|
if (error || argc != i+3 || *argv[i]=='-'|| (*SAPORT(&srv.intsa) = htons((uint16_t)atoi(argv[i])))==0 || ((srv.targetport = htons((uint16_t)atoi(argv[i+2])))==0
|
||||||
|
#ifdef WITH_UN
|
||||||
|
&& strncmp(argv[i+1], "unix:", 5)
|
||||||
|
#endif
|
||||||
|
)) {
|
||||||
#ifndef STDMAIN
|
#ifndef STDMAIN
|
||||||
haveerror = 1;
|
haveerror = 1;
|
||||||
#endif
|
#endif
|
||||||
@@ -830,35 +876,25 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
opt = 1;
|
opt = 1;
|
||||||
if(srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)))perror("setsockopt()");
|
if(srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)))perror("setsockopt()");
|
||||||
|
#else
|
||||||
|
/* A UDP service on Windows answers from a second socket bound to
|
||||||
|
the address it listens on, and Windows only allows that bind
|
||||||
|
when both sockets ask for it. */
|
||||||
|
if(isudp){
|
||||||
|
opt = 1;
|
||||||
|
if(srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(int)))perror("setsockopt()");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef SO_REUSEPORT
|
#ifdef SO_REUSEPORT
|
||||||
opt = 1;
|
opt = 1;
|
||||||
srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_REUSEPORT, (char *)&opt, sizeof(int));
|
srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_REUSEPORT, (char *)&opt, sizeof(int));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if defined SO_BINDTODEVICE
|
#if defined SO_BINDTODEVICE || defined IP_BOUND_IF
|
||||||
if(srv.ibindtodevice && srv.so._setsockopt(srv.so.state, sock, SOL_SOCKET, SO_BINDTODEVICE, srv.ibindtodevice, strlen(srv.ibindtodevice) + 1)) {
|
if(bindtodevice(&srv.so, srv.so.state, sock, srv.ibindtodevice, *SAFAMILY(&srv.intsa))) {
|
||||||
dolog(&defparam, (unsigned char *)"failed to bind device");
|
dolog(&defparam, (unsigned char *)"failed to bind device");
|
||||||
return -12;
|
return -12;
|
||||||
}
|
}
|
||||||
#elif defined IP_BOUND_IF
|
|
||||||
if(srv.ibindtodevice){
|
|
||||||
int idx;
|
|
||||||
idx = if_nametoindex(srv.ibindtodevice);
|
|
||||||
if(!idx || (*SAFAMILY(&srv.intsa) == AF_INET && setsockopt(sock, IPPROTO_IP, IP_BOUND_IF, &idx, sizeof(idx)))) {
|
|
||||||
dolog(&defparam, (unsigned char *)"failed to bind device");
|
|
||||||
return -12;
|
|
||||||
}
|
|
||||||
#ifndef NOIPV6
|
|
||||||
#ifndef IPV6_BOUND_IF
|
|
||||||
#define IPV6_BOUND_IF 125
|
|
||||||
#endif
|
|
||||||
if((*SAFAMILY(&srv.intsa) == AF_INET6 && srv.so._setsockopt(srv.so.state, sock, IPPROTO_IPV6, IPV6_BOUND_IF, &idx, sizeof(idx)))) {
|
|
||||||
dolog(&defparam, (unsigned char *)"failed to bind device");
|
|
||||||
return -12;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef WITH_UN
|
#ifdef WITH_UN
|
||||||
@@ -878,6 +914,9 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef WITH_UN
|
||||||
|
unbound(&srv);
|
||||||
|
#endif
|
||||||
if(!isudp){
|
if(!isudp){
|
||||||
if(srv.so._listen (srv.so.state, sock, srv.backlog?srv.backlog : 1+(srv.maxchild>>3))==-1) {
|
if(srv.so._listen (srv.so.state, sock, srv.backlog?srv.backlog : 1+(srv.maxchild>>3))==-1) {
|
||||||
sprintf((char *)buf, "listen(): %s", strerror(errno));
|
sprintf((char *)buf, "listen(): %s", strerror(errno));
|
||||||
@@ -956,6 +995,8 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
setopts(srv.cbsock, srv.cbssockopts);
|
setopts(srv.cbsock, srv.cbssockopts);
|
||||||
|
/* the clients of the service all wait for it: one accepts what comes */
|
||||||
|
nonblock(srv.cbsock);
|
||||||
|
|
||||||
if(srv.so._bind(srv.so.state, srv.cbsock, (struct sockaddr*)&cbsa, SASIZE(&cbsa))==-1) {
|
if(srv.so._bind(srv.so.state, srv.cbsock, (struct sockaddr*)&cbsa, SASIZE(&cbsa))==-1) {
|
||||||
dolog(&defparam, (unsigned char *)"Failed to bind connect back socket");
|
dolog(&defparam, (unsigned char *)"Failed to bind connect back socket");
|
||||||
@@ -1012,6 +1053,15 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
setopts(new_sock, srv.cbcsockopts);
|
setopts(new_sock, srv.cbcsockopts);
|
||||||
|
|
||||||
parsehost(srv.family, cbc_string, (struct sockaddr *)&defparam.sincr);
|
parsehost(srv.family, cbc_string, (struct sockaddr *)&defparam.sincr);
|
||||||
|
#if defined SO_BINDTODEVICE || defined IP_BOUND_IF
|
||||||
|
/* as for a listening socket, an interface that cannot be
|
||||||
|
bound to is not worth retrying */
|
||||||
|
if(bindtodevice(&so, so.state, new_sock, srv.ibindtodevice, *SAFAMILY(&defparam.sincr))) {
|
||||||
|
dolog(&defparam, (unsigned char *)"failed to bind device");
|
||||||
|
so._closesocket(so.state, new_sock);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(connectwithpoll(NULL, new_sock,(struct sockaddr *)&defparam.sincr,SASIZE(&defparam.sincr),CONNBACK_TO)) {
|
if(connectwithpoll(NULL, new_sock,(struct sockaddr *)&defparam.sincr,SASIZE(&defparam.sincr),CONNBACK_TO)) {
|
||||||
so._closesocket(so.state, new_sock);
|
so._closesocket(so.state, new_sock);
|
||||||
new_sock = INVALID_SOCKET;
|
new_sock = INVALID_SOCKET;
|
||||||
@@ -1019,7 +1069,7 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sockrecvfrom(NULL, new_sock,(struct sockaddr*)&defparam.sincr,buf,1,60*1000) != 1 || *buf!='C') {
|
if(sockrecvfrom(NULL, new_sock, NULL, buf, 1, 60*1000) != 1 || *buf!='C') {
|
||||||
so._closesocket(so.state, new_sock);
|
so._closesocket(so.state, new_sock);
|
||||||
new_sock = INVALID_SOCKET;
|
new_sock = INVALID_SOCKET;
|
||||||
usleep(SLEEPTIME);
|
usleep(SLEEPTIME);
|
||||||
@@ -1094,10 +1144,14 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
#else
|
#else
|
||||||
fcntl(new_sock,F_SETFL,O_NONBLOCK | fcntl(new_sock,F_GETFL));
|
fcntl(new_sock,F_SETFL,O_NONBLOCK | fcntl(new_sock,F_GETFL));
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _WIN32
|
||||||
|
/* Not on Windows: there closesocket() on a non-blocking socket with a linger
|
||||||
|
timeout fails with WSAEWOULDBLOCK while data is queued, leaving the socket
|
||||||
|
open. Without it the close completes in the background, data first. */
|
||||||
lg.l_onoff = 1;
|
lg.l_onoff = 1;
|
||||||
lg.l_linger = conf.timeouts[STRING_L];
|
lg.l_linger = conf.timeouts[STRING_L];
|
||||||
|
|
||||||
srv.so._setsockopt(srv.so.state, new_sock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
srv.so._setsockopt(srv.so.state, new_sock, SOL_SOCKET, SO_LINGER, (char *)&lg, sizeof(lg));
|
||||||
|
#endif
|
||||||
srv.so._setsockopt(srv.so.state, new_sock, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
|
srv.so._setsockopt(srv.so.state, new_sock, SOL_SOCKET, SO_OOBINLINE, (char *)&opt, sizeof(int));
|
||||||
}
|
}
|
||||||
#ifndef NOUDPMAIN
|
#ifndef NOUDPMAIN
|
||||||
@@ -1315,14 +1369,23 @@ void srvfree(struct srvparam * srv){
|
|||||||
if(srv->srvsock != INVALID_SOCKET) {
|
if(srv->srvsock != INVALID_SOCKET) {
|
||||||
so._closesocket(srv->so.state, srv->srvsock);
|
so._closesocket(srv->so.state, srv->srvsock);
|
||||||
#ifdef WITH_UN
|
#ifdef WITH_UN
|
||||||
if(*SAFAMILY(&srv->intsa) == AF_UNIX && *SAADDR(&srv->intsa))unlink((char *)SAADDR(&srv->intsa));
|
ununlink(srv);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
srv->srvsock = INVALID_SOCKET;
|
srv->srvsock = INVALID_SOCKET;
|
||||||
if(srv->cbsock != INVALID_SOCKET) so._closesocket(srv->so.state, srv->cbsock);
|
if(srv->cbsock != INVALID_SOCKET) so._closesocket(srv->so.state, srv->cbsock);
|
||||||
srv->cbsock = INVALID_SOCKET;
|
srv->cbsock = INVALID_SOCKET;
|
||||||
srv->service = S_ZOMBIE;
|
srv->service = S_ZOMBIE;
|
||||||
while(srv->child) usleep(SLEEPTIME * 100);
|
/* under the mutex, so the last child has let go of it before it is destroyed */
|
||||||
|
for(;;){
|
||||||
|
struct clientparam *child;
|
||||||
|
|
||||||
|
_3proxy_mutex_lock(&srv->counter_mutex);
|
||||||
|
child = srv->child;
|
||||||
|
_3proxy_mutex_unlock(&srv->counter_mutex);
|
||||||
|
if(!child) break;
|
||||||
|
usleep(SLEEPTIME * 100);
|
||||||
|
}
|
||||||
#ifndef STDMAIN
|
#ifndef STDMAIN
|
||||||
if(srv->filter){
|
if(srv->filter){
|
||||||
while(srv->nfilters){
|
while(srv->nfilters){
|
||||||
@@ -1364,40 +1427,44 @@ void srvfree(struct srvparam * srv){
|
|||||||
void freeparam(struct clientparam * param) {
|
void freeparam(struct clientparam * param) {
|
||||||
if(param->srv){
|
if(param->srv){
|
||||||
if(param->srv->so.freefunc) param->srv->so.freefunc(param->sostate);
|
if(param->srv->so.freefunc) param->srv->so.freefunc(param->sostate);
|
||||||
_3proxy_mutex_lock(¶m->srv->counter_mutex);
|
|
||||||
#ifndef STDMAIN
|
#ifndef STDMAIN
|
||||||
if(param->srv->service == S_UDPPM) hashdelete(&udp_table, param);
|
if(param->srv->service == S_UDPPM){
|
||||||
#endif
|
_3proxy_mutex_lock(¶m->srv->counter_mutex);
|
||||||
if(param->prev || param->next || param->srv->child == param){
|
hashdelete(&udp_table, param);
|
||||||
if(param->prev){
|
_3proxy_mutex_unlock(¶m->srv->counter_mutex);
|
||||||
param->prev->next = param->next;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
param->srv->child = param->next;
|
|
||||||
if(param->next){
|
|
||||||
param->next->prev = param->prev;
|
|
||||||
}
|
|
||||||
(param->srv->childcount)--;
|
|
||||||
}
|
}
|
||||||
_3proxy_mutex_unlock(¶m->srv->counter_mutex);
|
#endif
|
||||||
}
|
}
|
||||||
if(param->clibuf) free(param->clibuf);
|
if(param->clibuf) free(param->clibuf);
|
||||||
if(param->srvbuf) free(param->srvbuf);
|
if(param->srvbuf) free(param->srvbuf);
|
||||||
|
/* Not shut down on Windows: there shutting down receiving resets the
|
||||||
|
connection as soon as the peer sends anything more, and close()
|
||||||
|
alone sends whatever is queued before its FIN. Elsewhere it stays:
|
||||||
|
on the BSDs it discards what is left unread, so the close that
|
||||||
|
follows is not turned into a reset. */
|
||||||
if(param->srv) {
|
if(param->srv) {
|
||||||
if(param->ctrlsocksrv != INVALID_SOCKET && param->ctrlsocksrv != param->remsock) {
|
if(param->ctrlsocksrv != INVALID_SOCKET && param->ctrlsocksrv != param->remsock) {
|
||||||
|
#ifndef _WIN32
|
||||||
param->srv->so._shutdown(param->sostate, param->ctrlsocksrv, SHUT_RDWR);
|
param->srv->so._shutdown(param->sostate, param->ctrlsocksrv, SHUT_RDWR);
|
||||||
|
#endif
|
||||||
param->srv->so._closesocket(param->sostate, param->ctrlsocksrv);
|
param->srv->so._closesocket(param->sostate, param->ctrlsocksrv);
|
||||||
}
|
}
|
||||||
if(param->ctrlsock != INVALID_SOCKET && param->ctrlsock != param->clisock) {
|
if(param->ctrlsock != INVALID_SOCKET && param->ctrlsock != param->clisock) {
|
||||||
|
#ifndef _WIN32
|
||||||
param->srv->so._shutdown(param->sostate, param->ctrlsock, SHUT_RDWR);
|
param->srv->so._shutdown(param->sostate, param->ctrlsock, SHUT_RDWR);
|
||||||
|
#endif
|
||||||
param->srv->so._closesocket(param->sostate, param->ctrlsock);
|
param->srv->so._closesocket(param->sostate, param->ctrlsock);
|
||||||
}
|
}
|
||||||
if(param->remsock != INVALID_SOCKET) {
|
if(param->remsock != INVALID_SOCKET) {
|
||||||
|
#ifndef _WIN32
|
||||||
param->srv->so._shutdown(param->sostate, param->remsock, SHUT_RDWR);
|
param->srv->so._shutdown(param->sostate, param->remsock, SHUT_RDWR);
|
||||||
|
#endif
|
||||||
param->srv->so._closesocket(param->sostate, param->remsock);
|
param->srv->so._closesocket(param->sostate, param->remsock);
|
||||||
}
|
}
|
||||||
if(param->clisock != INVALID_SOCKET) {
|
if(param->clisock != INVALID_SOCKET) {
|
||||||
|
#ifndef _WIN32
|
||||||
param->srv->so._shutdown(param->sostate, param->clisock, SHUT_RDWR);
|
param->srv->so._shutdown(param->sostate, param->clisock, SHUT_RDWR);
|
||||||
|
#endif
|
||||||
param->srv->so._closesocket(param->sostate, param->clisock);
|
param->srv->so._closesocket(param->sostate, param->clisock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1419,6 +1486,24 @@ void freeparam(struct clientparam * param) {
|
|||||||
}
|
}
|
||||||
if(param->connlim) stopconnlims(param);
|
if(param->connlim) stopconnlims(param);
|
||||||
#endif
|
#endif
|
||||||
|
/* Leaving the service comes last. Once its last child is gone, srvfree()
|
||||||
|
frees the service along with its socket functions, filters and mutex,
|
||||||
|
and a close above may have lingered for seconds before getting here. */
|
||||||
|
if(param->srv){
|
||||||
|
_3proxy_mutex_lock(¶m->srv->counter_mutex);
|
||||||
|
if(param->prev || param->next || param->srv->child == param){
|
||||||
|
if(param->prev){
|
||||||
|
param->prev->next = param->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
param->srv->child = param->next;
|
||||||
|
if(param->next){
|
||||||
|
param->next->prev = param->prev;
|
||||||
|
}
|
||||||
|
(param->srv->childcount)--;
|
||||||
|
}
|
||||||
|
_3proxy_mutex_unlock(¶m->srv->counter_mutex);
|
||||||
|
}
|
||||||
if(param->hostname) free(param->hostname);
|
if(param->hostname) free(param->hostname);
|
||||||
if(param->username) free(param->username);
|
if(param->username) free(param->username);
|
||||||
if(param->password) free(param->password);
|
if(param->password) free(param->password);
|
||||||
@@ -1658,9 +1743,17 @@ FILTER_ACTION makefilters (struct srvparam *srv, struct clientparam *param){
|
|||||||
|
|
||||||
for(i=0; i<srv->nfilters; i++){
|
for(i=0; i<srv->nfilters; i++){
|
||||||
if(!srv->filter[i].filter_client)continue;
|
if(!srv->filter[i].filter_client)continue;
|
||||||
|
/* the slots are not cleared when they are allocated */
|
||||||
|
param->filters[param->nfilters].data = NULL;
|
||||||
action = (*srv->filter[i].filter_client)(srv->filter[i].data, param, ¶m->filters[param->nfilters].data);
|
action = (*srv->filter[i].filter_client)(srv->filter[i].data, param, ¶m->filters[param->nfilters].data);
|
||||||
if(action == PASS) continue;
|
if(action == PASS) continue;
|
||||||
if(action > CONTINUE) return action;
|
if(action > CONTINUE) {
|
||||||
|
/* a filter refusing the connection is not kept, but it may
|
||||||
|
have made a state for it */
|
||||||
|
if(srv->filter[i].filter_clear && param->filters[param->nfilters].data)
|
||||||
|
(*srv->filter[i].filter_clear)(param->filters[param->nfilters].data);
|
||||||
|
return action;
|
||||||
|
}
|
||||||
param->filters[param->nfilters].filter = srv->filter + i;
|
param->filters[param->nfilters].filter = srv->filter + i;
|
||||||
if(srv->filter[i].filter_request)param->reqfilters[param->nreqfilters++] = param->filters + param->nfilters;
|
if(srv->filter[i].filter_request)param->reqfilters[param->nreqfilters++] = param->filters + param->nfilters;
|
||||||
if(srv->filter[i].filter_connect)param->connectfilters[param->nconnectfilters++] = param->filters + param->nfilters;
|
if(srv->filter[i].filter_connect)param->connectfilters[param->nconnectfilters++] = param->filters + param->nfilters;
|
||||||
|
|||||||
+7
-4
@@ -167,6 +167,7 @@ uint32_t udpresolve(int af, unsigned char * name, unsigned char * value, uint32_
|
|||||||
k += 4;
|
k += 4;
|
||||||
if(na > 255) na = 255; /* somebody is very evil */
|
if(na > 255) na = 255; /* somebody is very evil */
|
||||||
for (j = 0; j < na; j++) { /* now there should be answers */
|
for (j = 0; j < na; j++) { /* now there should be answers */
|
||||||
|
if(k >= len) break;
|
||||||
while(buf[k] < 192 && buf[k] !=0 && (k+buf[k]+14) < len) k+= (buf[k] + 1);
|
while(buf[k] < 192 && buf[k] !=0 && (k+buf[k]+14) < len) k+= (buf[k] + 1);
|
||||||
if(!buf[k]) k--;
|
if(!buf[k]) k--;
|
||||||
if((k+(af == AF_INET6?28:16)) > len) {
|
if((k+(af == AF_INET6?28:16)) > len) {
|
||||||
@@ -195,12 +196,14 @@ uint32_t udpresolve(int af, unsigned char * name, unsigned char * value, uint32_
|
|||||||
k+= (12 + flen);
|
k+= (12 + flen);
|
||||||
continue; /* we need A PTR */
|
continue; /* we need A PTR */
|
||||||
}
|
}
|
||||||
for (s2 = buf + k + 12; s2 < (buf + k + 12 + len) && *s2; ){
|
s1 = buf + k + 12 + flen; /* the end of this record's data, inside the answer */
|
||||||
s1 = s2 + ((unsigned)*s2) + 1;
|
for (s2 = buf + k + 12; s2 < s1 && *s2 && *s2 < 64; ){
|
||||||
|
unsigned char *next = s2 + ((unsigned)*s2) + 1;
|
||||||
*s2 = '.';
|
*s2 = '.';
|
||||||
s2 = s1;
|
s2 = next;
|
||||||
}
|
}
|
||||||
*s2 = 0;
|
if(s2 >= s1 || *s2 || s2 == buf + k + 12)
|
||||||
|
break; /* the name runs past its data, is compressed or empty */
|
||||||
if(param->username)free(param->username);
|
if(param->username)free(param->username);
|
||||||
param->username = (unsigned char *)strdup ((char *)buf + k + 13);
|
param->username = (unsigned char *)strdup ((char *)buf + k + 13);
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -159,7 +159,10 @@ void * smtppchild(struct clientparam* param) {
|
|||||||
i = de64(buf,username,255);
|
i = de64(buf,username,255);
|
||||||
if(i < 1) {RETURN(664);}
|
if(i < 1) {RETURN(664);}
|
||||||
username[i] = 0;
|
username[i] = 0;
|
||||||
parseconnusername((char *)username, param, 0, 587);
|
/* The name has to carry the host to connect to, and the answer says
|
||||||
|
whether it did: without one there is nowhere to go, and what follows
|
||||||
|
reads the name as if there were. */
|
||||||
|
if(parseconnusername((char *)username, param, 0, 587)) {RETURN(669);}
|
||||||
socksend(param, param->clisock, (unsigned char *)"334 UGFzc3dvcmQ6\r\n", 18,conf.timeouts[STRING_S]);
|
socksend(param, param->clisock, (unsigned char *)"334 UGFzc3dvcmQ6\r\n", 18,conf.timeouts[STRING_S]);
|
||||||
i = sockgetlinebuf(param, CLIENT, buf, sizeof(buf) - 10, '\n', conf.timeouts[STRING_S]);
|
i = sockgetlinebuf(param, CLIENT, buf, sizeof(buf) - 10, '\n', conf.timeouts[STRING_S]);
|
||||||
if(i < 2) {RETURN(665);}
|
if(i < 2) {RETURN(665);}
|
||||||
@@ -184,7 +187,7 @@ void * smtppchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
if(i < 3 || *username) {RETURN(668);}
|
if(i < 3 || *username) {RETURN(668);}
|
||||||
username[i] = 0;
|
username[i] = 0;
|
||||||
parseconnusername((char *)username+1, param, 0, 587);
|
if(parseconnusername((char *)username+1, param, 0, 587)) {RETURN(670);}
|
||||||
res = (int)strlen((char *)username+1) + 2;
|
res = (int)strlen((char *)username+1) + 2;
|
||||||
if(res < i){
|
if(res < i){
|
||||||
if(param->extpassword) free(param->extpassword);
|
if(param->extpassword) free(param->extpassword);
|
||||||
|
|||||||
+15
-8
@@ -60,14 +60,21 @@ int sockrecvfrom(struct clientparam *param, SOCKET sock, struct sockaddr * sin,
|
|||||||
|
|
||||||
fds.fd = sock;
|
fds.fd = sock;
|
||||||
fds.events = POLLIN;
|
fds.events = POLLIN;
|
||||||
if(conf.timetoexit) return EOF;
|
for(;;){
|
||||||
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
if(conf.timetoexit) return EOF;
|
||||||
if (res<1) return 0;
|
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
||||||
sasize = SASIZE(sin);
|
if (res<1) return 0;
|
||||||
do {
|
sasize = sizeof(PROXYSOCKADDRTYPE);
|
||||||
res = param?param->srv->so._recvfrom(param->sostate, sock, (char *)buf, bufsize, 0, (struct sockaddr *)sin, &sasize):so._recvfrom(so.state, sock, (char *)buf, bufsize, 0, (struct sockaddr *)sin, &sasize);
|
/* sin NULL for a stream socket: nothing to learn the address into */
|
||||||
} while (res < 0 && (errno == EAGAIN || errno == EINTR));
|
do {
|
||||||
return res;
|
res = param?param->srv->so._recvfrom(param->sostate, sock, (char *)buf, bufsize, 0, (struct sockaddr *)sin, sin? &sasize : NULL):so._recvfrom(so.state, sock, (char *)buf, bufsize, 0, (struct sockaddr *)sin, sin? &sasize : NULL);
|
||||||
|
} while (res < 0 && errno == EINTR);
|
||||||
|
/* readable and still nothing to read: over TLS a record not yet
|
||||||
|
whole. Read again, without polling, it would only be the same until
|
||||||
|
the rest came, a loop taking all of a CPU and never timing out: the
|
||||||
|
socket is polled for it instead. */
|
||||||
|
if(res >= 0 || errno != EAGAIN) return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){
|
int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){
|
||||||
|
|||||||
+59
-18
@@ -49,6 +49,28 @@ ssize_t splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t le
|
|||||||
before the sockets are closed. */
|
before the sockets are closed. */
|
||||||
#define SESSIONEND (!halfclose && (CLIENTTERMREAD || SERVERTERMREAD))
|
#define SESSIONEND (!halfclose && (CLIENTTERMREAD || SERVERTERMREAD))
|
||||||
|
|
||||||
|
/* A hang-up on a socket there is data to write to. With poll() it comes
|
||||||
|
once both sides are shut down, and the write tried then fails, which ends
|
||||||
|
it. WSAPoll reports it as soon as the peer has half-closed, a peer still
|
||||||
|
reading, and keeps reporting it whether the socket has room or not: room
|
||||||
|
is waited for with select() then, up to timeo seconds. Returns whether to
|
||||||
|
try the write. */
|
||||||
|
static int hupwrite(SOCKET s, short revents, int timeo){
|
||||||
|
#ifdef _WIN32
|
||||||
|
if(!(revents & POLLOUT)){
|
||||||
|
fd_set wfd;
|
||||||
|
struct timeval tv;
|
||||||
|
|
||||||
|
FD_ZERO(&wfd);
|
||||||
|
FD_SET(s, &wfd);
|
||||||
|
tv.tv_sec = timeo;
|
||||||
|
tv.tv_usec = 0;
|
||||||
|
if(select(0, NULL, &wfd, NULL, &tv) < 1) return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int sockmap(struct clientparam * param, int timeo, int usesplice){
|
int sockmap(struct clientparam * param, int timeo, int usesplice){
|
||||||
int halfclose = param->srv->halfclose;
|
int halfclose = param->srv->halfclose;
|
||||||
uint64_t fromclient=0x7fffffffffffffff, fromserver =0x7fffffffffffffff;
|
uint64_t fromclient=0x7fffffffffffffff, fromserver =0x7fffffffffffffff;
|
||||||
@@ -60,13 +82,16 @@ int sockmap(struct clientparam * param, int timeo, int usesplice){
|
|||||||
#endif
|
#endif
|
||||||
int HASERROR=0;
|
int HASERROR=0;
|
||||||
int CLIENTTERMREAD = 0, CLIENTTERMWRITE = 0, SERVERTERMREAD = 0, SERVERTERMWRITE = 0;
|
int CLIENTTERMREAD = 0, CLIENTTERMWRITE = 0, SERVERTERMREAD = 0, SERVERTERMWRITE = 0;
|
||||||
|
/* the side has hung up: closed by the peer after its own was shut down */
|
||||||
|
int CLIENTHUP = 0, SERVERHUP = 0;
|
||||||
|
/* whether the side's socket is in this round's poll() */
|
||||||
|
int clipolled = 1, srvpolled = 1;
|
||||||
int after = 0;
|
int after = 0;
|
||||||
struct pollfd fds[8];
|
struct pollfd fds[8];
|
||||||
int fdsc = 0;
|
int fdsc = 0;
|
||||||
int sleeptime = 0;
|
int sleeptime = 0;
|
||||||
FILTER_ACTION action;
|
FILTER_ACTION action;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
SASIZETYPE sasize;
|
|
||||||
int needaction = 0;
|
int needaction = 0;
|
||||||
int graceclinum=0, gracesrvnum=0, graceclitraf=0, gracesrvtraf=0;
|
int graceclinum=0, gracesrvnum=0, graceclitraf=0, gracesrvtraf=0;
|
||||||
time_t gracetime = 0;
|
time_t gracetime = 0;
|
||||||
@@ -220,8 +245,7 @@ log("send to server from buf");
|
|||||||
param->clioffset = param->cliinbuf = 0;
|
param->clioffset = param->cliinbuf = 0;
|
||||||
if(fromclient) TOCLIENTBUF = 1;
|
if(fromclient) TOCLIENTBUF = 1;
|
||||||
}
|
}
|
||||||
sasize = SASIZE(¶m->sinsr);
|
res = param->srv->so._sendto(param->sostate, param->remsock, (char *)param->clibuf + param->clioffset, (int)MIN(inclientbuf, fromclient), 0, NULL, 0);
|
||||||
res = param->srv->so._sendto(param->sostate, param->remsock, (char *)param->clibuf + param->clioffset, (int)MIN(inclientbuf, fromclient), 0, (struct sockaddr*)¶m->sinsr, sasize);
|
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
TOSERVER = 0;
|
TOSERVER = 0;
|
||||||
if(errno && errno != EAGAIN && errno != EINTR){
|
if(errno && errno != EAGAIN && errno != EINTR){
|
||||||
@@ -267,8 +291,7 @@ log("send to client from buf");
|
|||||||
if(fromserver) TOSERVERBUF = 1;
|
if(fromserver) TOSERVERBUF = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sasize = SASIZE(¶m->sincr);
|
res = param->srv->so._sendto(param->sostate, param->clisock, (char *)param->srvbuf + param->srvoffset, (int)MIN(inserverbuf,fromserver), 0, NULL, 0);
|
||||||
res = param->srv->so._sendto(param->sostate, param->clisock, (char *)param->srvbuf + param->srvoffset, (int)MIN(inserverbuf,fromserver), 0, (struct sockaddr*)¶m->sincr, sasize);
|
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
TOCLIENT = 0;
|
TOCLIENT = 0;
|
||||||
if(errno && errno != EAGAIN && errno != EINTR){
|
if(errno && errno != EAGAIN && errno != EINTR){
|
||||||
@@ -459,8 +482,7 @@ log("done read from server to pipe\n");
|
|||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
log("read from client to buf");
|
log("read from client to buf");
|
||||||
#endif
|
#endif
|
||||||
sasize = sizeof(param->sincr);
|
res = param->srv->so._recvfrom(param->sostate, param->clisock, (char *)param->clibuf + param->cliinbuf, (int)MIN((uint64_t)param->clibufsize - param->cliinbuf, fromclient-inclientbuf), 0, NULL, NULL);
|
||||||
res = param->srv->so._recvfrom(param->sostate, param->clisock, (char *)param->clibuf + param->cliinbuf, (int)MIN((uint64_t)param->clibufsize - param->cliinbuf, fromclient-inclientbuf), 0, (struct sockaddr *)¶m->sincr, &sasize);
|
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
FROMCLIENT = 0;
|
FROMCLIENT = 0;
|
||||||
if(res == 0) {
|
if(res == 0) {
|
||||||
@@ -492,8 +514,7 @@ log("done read from client to buf");
|
|||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
log("read from server to buf");
|
log("read from server to buf");
|
||||||
#endif
|
#endif
|
||||||
sasize = sizeof(param->sinsr);
|
res = param->srv->so._recvfrom(param->sostate, param->remsock, (char *)param->srvbuf + param->srvinbuf, (int)MIN((uint64_t)param->srvbufsize - param->srvinbuf, fromserver-inserverbuf), 0, NULL, NULL);
|
||||||
res = param->srv->so._recvfrom(param->sostate, param->remsock, (char *)param->srvbuf + param->srvinbuf, (int)MIN((uint64_t)param->srvbufsize - param->srvinbuf, fromserver-inserverbuf), 0, (struct sockaddr *)¶m->sinsr, &sasize);
|
|
||||||
if(res <= 0) {
|
if(res <= 0) {
|
||||||
FROMSERVER = 0;
|
FROMSERVER = 0;
|
||||||
if(res == 0) {
|
if(res == 0) {
|
||||||
@@ -569,6 +590,11 @@ log("done read from server to buf");
|
|||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
cli_events |= POLLOUT;
|
cli_events |= POLLOUT;
|
||||||
|
/* poll() reports a hang-up whatever is asked, and would
|
||||||
|
return at once every time: the socket is left out then,
|
||||||
|
rather than given as an invalid one, which WSAPoll takes
|
||||||
|
for an error */
|
||||||
|
clipolled = cli_events || !CLIENTHUP;
|
||||||
if(cli_events){
|
if(cli_events){
|
||||||
fds[fdsc].fd = param->clisock;
|
fds[fdsc].fd = param->clisock;
|
||||||
fds[fdsc].events = cli_events;
|
fds[fdsc].events = cli_events;
|
||||||
@@ -580,6 +606,8 @@ log("wait writing to client");
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(!clipolled){
|
||||||
|
}
|
||||||
else if(cli_events){
|
else if(cli_events){
|
||||||
if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
||||||
CLIENTTERMREAD = 1;
|
CLIENTTERMREAD = 1;
|
||||||
@@ -601,14 +629,21 @@ log("ready to write to client");
|
|||||||
}
|
}
|
||||||
if(fds[fdsc].revents & (POLLHUP)) {
|
if(fds[fdsc].revents & (POLLHUP)) {
|
||||||
if(fds[fdsc].events & POLLIN) FROMCLIENT = 1;
|
if(fds[fdsc].events & POLLIN) FROMCLIENT = 1;
|
||||||
if(fds[fdsc].events & POLLOUT) CLIENTTERMWRITE = 1;
|
if(fds[fdsc].events & POLLOUT){
|
||||||
|
if(hupwrite(param->clisock, fds[fdsc].revents, timeo)) TOCLIENT = 1;
|
||||||
|
else CLIENTTERMWRITE = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(fds[fdsc].revents & (POLLERR|POLLNVAL|POLLHUP)) {
|
} else if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
||||||
CLIENTTERMREAD = 1;
|
CLIENTTERMREAD = 1;
|
||||||
CLIENTTERMWRITE = 1;
|
CLIENTTERMWRITE = 1;
|
||||||
|
} else if(fds[fdsc].revents & POLLHUP) {
|
||||||
|
/* what the client sent before it closed is still to be
|
||||||
|
read, once the buffer has room for it */
|
||||||
|
CLIENTHUP = 1;
|
||||||
}
|
}
|
||||||
fdsc++;
|
if(clipolled) fdsc++;
|
||||||
|
|
||||||
// if(!SERVERTERMREAD || !SERVERTERMWRITE){
|
// if(!SERVERTERMREAD || !SERVERTERMWRITE){
|
||||||
if(!after){
|
if(!after){
|
||||||
@@ -629,6 +664,7 @@ log("ready to write to client");
|
|||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
srv_events |= POLLOUT;
|
srv_events |= POLLOUT;
|
||||||
|
srvpolled = srv_events || !SERVERHUP;
|
||||||
if(srv_events){
|
if(srv_events){
|
||||||
fds[fdsc].fd = param->remsock;
|
fds[fdsc].fd = param->remsock;
|
||||||
fds[fdsc].events = srv_events;
|
fds[fdsc].events = srv_events;
|
||||||
@@ -640,6 +676,8 @@ log("wait writing from server");
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(!srvpolled){
|
||||||
|
}
|
||||||
else if(srv_events){
|
else if(srv_events){
|
||||||
if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
||||||
#ifdef WITHLOG
|
#ifdef WITHLOG
|
||||||
@@ -668,14 +706,20 @@ log("ready to write to server");
|
|||||||
log("server terminated connection");
|
log("server terminated connection");
|
||||||
#endif
|
#endif
|
||||||
if(fds[fdsc].events & POLLIN) FROMSERVER = 1;
|
if(fds[fdsc].events & POLLIN) FROMSERVER = 1;
|
||||||
if(fds[fdsc].events & POLLOUT) SERVERTERMWRITE = 1;
|
if(fds[fdsc].events & POLLOUT){
|
||||||
|
if(hupwrite(param->remsock, fds[fdsc].revents, timeo)) TOSERVER = 1;
|
||||||
|
else SERVERTERMWRITE = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(fds[fdsc].revents & (POLLERR|POLLNVAL|POLLHUP)) {
|
} else if(fds[fdsc].revents & (POLLERR|POLLNVAL)) {
|
||||||
SERVERTERMREAD = 1;
|
SERVERTERMREAD = 1;
|
||||||
SERVERTERMWRITE = 1;
|
SERVERTERMWRITE = 1;
|
||||||
|
} else if(fds[fdsc].revents & POLLHUP) {
|
||||||
|
/* the rest of the answer may still be waiting to be read */
|
||||||
|
SERVERHUP = 1;
|
||||||
}
|
}
|
||||||
fdsc++;
|
if(srvpolled) fdsc++;
|
||||||
// }
|
// }
|
||||||
#ifdef WITHSPLICE
|
#ifdef WITHSPLICE
|
||||||
if(usesplice){
|
if(usesplice){
|
||||||
@@ -819,9 +863,6 @@ log("timeout");
|
|||||||
else if(inclientpipe || inserverpipe) res = 94;
|
else if(inclientpipe || inserverpipe) res = 94;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if((param->nwrites > 0 && !SERVERTERMWRITE) || (param->nreads > 0 && !CLIENTTERMWRITE))
|
|
||||||
usleep(SLEEPTIME * 10);
|
|
||||||
|
|
||||||
CLEANRET:
|
CLEANRET:
|
||||||
|
|
||||||
#ifdef WITHSPLICE
|
#ifdef WITHSPLICE
|
||||||
|
|||||||
+15
-8
@@ -185,6 +185,7 @@ void * sockschild(struct clientparam* param) {
|
|||||||
if(command == 2){
|
if(command == 2){
|
||||||
if ((param->remsock=param->srv->so._socket(param->sostate, SASOCK(¶m->req), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN (11);}
|
if ((param->remsock=param->srv->so._socket(param->sostate, SASOCK(¶m->req), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN (11);}
|
||||||
setopts(param->remsock, param->srv->lissockopts);
|
setopts(param->remsock, param->srv->lissockopts);
|
||||||
|
if(extbindtodevice(param, param->remsock)) {RETURN (12);}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -226,7 +227,7 @@ fprintf(stderr, "%hu bound to communicate with server\n", *SAPORT(¶m->sinsl)
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
sasize = SASIZE(¶m->sinsl);
|
sasize = sizeof(param->sinsl);
|
||||||
param->srv->so._getsockname(param->sostate, param->remsock, (struct sockaddr *)¶m->sinsl, &sasize);
|
param->srv->so._getsockname(param->sostate, param->remsock, (struct sockaddr *)¶m->sinsl, &sasize);
|
||||||
}
|
}
|
||||||
if(command == 3) {
|
if(command == 3) {
|
||||||
@@ -241,10 +242,11 @@ fflush(stderr);
|
|||||||
#else
|
#else
|
||||||
fcntl(param->clisock, F_SETFL, O_NONBLOCK | fcntl(param->clisock, F_GETFL));
|
fcntl(param->clisock, F_SETFL, O_NONBLOCK | fcntl(param->clisock, F_GETFL));
|
||||||
#endif
|
#endif
|
||||||
|
if(intbindtodevice(param, param->clisock)) {RETURN (12);}
|
||||||
sin = param->sincl;
|
sin = param->sincl;
|
||||||
*SAPORT(&sin) = 0;
|
*SAPORT(&sin) = 0;
|
||||||
if(param->srv->so._bind(param->sostate, param->clisock,(struct sockaddr *)&sin,SASIZE(&sin))) {RETURN (12);}
|
if(param->srv->so._bind(param->sostate, param->clisock,(struct sockaddr *)&sin,SASIZE(&sin))) {RETURN (12);}
|
||||||
sasize = SASIZE(&sin);
|
sasize = sizeof(sin);
|
||||||
param->srv->so._getsockname(param->sostate, param->clisock, (struct sockaddr *)&sin, &sasize);
|
param->srv->so._getsockname(param->sostate, param->clisock, (struct sockaddr *)&sin, &sasize);
|
||||||
#if SOCKSTRACE > 0
|
#if SOCKSTRACE > 0
|
||||||
fprintf(stderr, "%hu binded to communicate with client\n",
|
fprintf(stderr, "%hu binded to communicate with client\n",
|
||||||
@@ -266,12 +268,17 @@ CLEANRET:
|
|||||||
int repcode;
|
int repcode;
|
||||||
|
|
||||||
sasize = sizeof(sin);
|
sasize = sizeof(sin);
|
||||||
if(command != 3 && param->remsock != INVALID_SOCKET) param->srv->so._getsockname(param->sostate, param->remsock, (struct sockaddr *)&sin, &sasize);
|
/* CONNECT and BIND report the address of the socket towards the
|
||||||
if(command != 3 && !SAISNULL(¶m->srv->extNat)){
|
destination, UDP ASSOCIATE the one the client sends its datagrams
|
||||||
uint16_t port;
|
to, as does a request which never got a socket of its own */
|
||||||
port = *SAPORT(&sin);
|
if(command != 3 && param->remsock != INVALID_SOCKET){
|
||||||
sin = param->srv->extNat;
|
param->srv->so._getsockname(param->sostate, param->remsock, (struct sockaddr *)&sin, &sasize);
|
||||||
*SAPORT(&sin) = port;
|
if(!SAISNULL(¶m->srv->extNat)){
|
||||||
|
uint16_t port;
|
||||||
|
port = *SAPORT(&sin);
|
||||||
|
sin = param->srv->extNat;
|
||||||
|
*SAPORT(&sin) = port;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
param->srv->so._getsockname(param->sostate, param->clisock, (struct sockaddr *)&sin, &sasize);
|
param->srv->so._getsockname(param->sostate, param->clisock, (struct sockaddr *)&sin, &sasize);
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ static int client_mode = 0;
|
|||||||
struct SSLsock {
|
struct SSLsock {
|
||||||
SOCKET s;
|
SOCKET s;
|
||||||
SSL_CONN conn;
|
SSL_CONN conn;
|
||||||
|
/* what a read and a write which could not be done wait for, POLLIN
|
||||||
|
or POLLOUT, 0 once one is: TLS may have to write to read */
|
||||||
|
short rwant, wwant;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SSLstate {
|
struct SSLstate {
|
||||||
@@ -102,10 +105,12 @@ static void addSSL(
|
|||||||
if (cli_s != INVALID_SOCKET){
|
if (cli_s != INVALID_SOCKET){
|
||||||
SOSTATE->cli.s = cli_s;
|
SOSTATE->cli.s = cli_s;
|
||||||
SOSTATE->cli.conn = cli_conn;
|
SOSTATE->cli.conn = cli_conn;
|
||||||
|
SOSTATE->cli.rwant = SOSTATE->cli.wwant = 0;
|
||||||
}
|
}
|
||||||
if (srv_s != INVALID_SOCKET){
|
if (srv_s != INVALID_SOCKET){
|
||||||
SOSTATE->srv.s = srv_s;
|
SOSTATE->srv.s = srv_s;
|
||||||
SOSTATE->srv.conn = srv_conn;
|
SOSTATE->srv.conn = srv_conn;
|
||||||
|
SOSTATE->srv.rwant = SOSTATE->srv.wwant = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,12 +141,14 @@ static ssize_t ssl_send(void *state, SOCKET s, const void *msg, size_t len, int
|
|||||||
int res, err;
|
int res, err;
|
||||||
if((res = ssl_write(sslq->conn, (void *)msg, len)) <= 0){
|
if((res = ssl_write(sslq->conn, (void *)msg, len)) <= 0){
|
||||||
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
||||||
if (err == SSL_ERROR_WANT_WRITE){
|
if (err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_READ){
|
||||||
|
sslq->wwant = (err == SSL_ERROR_WANT_READ)? POLLIN : POLLOUT;
|
||||||
seterrno3(EAGAIN);
|
seterrno3(EAGAIN);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else seterrno3(err);
|
else seterrno3(err);
|
||||||
}
|
}
|
||||||
|
else sslq->wwant = 0;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,14 +165,16 @@ static ssize_t ssl_sendto(void *state, SOCKET s, const void *msg, size_t len, in
|
|||||||
|
|
||||||
if ((sslq = searchSSL(state, s))){
|
if ((sslq = searchSSL(state, s))){
|
||||||
int res, err;
|
int res, err;
|
||||||
if((res = ssl_write(sslq->conn, (void *)msg, len)) <= 0) {
|
if((res = ssl_write(sslq->conn, (void *)msg, len)) <= 0){
|
||||||
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
||||||
if (err == SSL_ERROR_WANT_WRITE){
|
if (err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_READ){
|
||||||
|
sslq->wwant = (err == SSL_ERROR_WANT_READ)? POLLIN : POLLOUT;
|
||||||
seterrno3(EAGAIN);
|
seterrno3(EAGAIN);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else seterrno3(err);
|
else seterrno3(err);
|
||||||
}
|
}
|
||||||
|
else sslq->wwant = 0;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,12 +192,14 @@ static ssize_t ssl_recvfrom(void *state, SOCKET s, void *msg, size_t len, int f
|
|||||||
int res, err;
|
int res, err;
|
||||||
if((res = ssl_read(sslq->conn, (void *)msg, len)) <= 0) {
|
if((res = ssl_read(sslq->conn, (void *)msg, len)) <= 0) {
|
||||||
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
||||||
if (err == SSL_ERROR_WANT_READ) {
|
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
|
||||||
|
sslq->rwant = (err == SSL_ERROR_WANT_WRITE)? POLLOUT : POLLIN;
|
||||||
seterrno3(EAGAIN);
|
seterrno3(EAGAIN);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else seterrno3(err);
|
else seterrno3(err);
|
||||||
}
|
}
|
||||||
|
else sslq->rwant = 0;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
return sso._recvfrom(sso.state, s, msg, len, flags, from, fromlen);
|
return sso._recvfrom(sso.state, s, msg, len, flags, from, fromlen);
|
||||||
@@ -205,12 +216,14 @@ static ssize_t ssl_recv(void *state, SOCKET s, void *msg, size_t len, int flags)
|
|||||||
int res, err;
|
int res, err;
|
||||||
if((res = ssl_read(sslq->conn, (void *)msg, len)) <= 0) {
|
if((res = ssl_read(sslq->conn, (void *)msg, len)) <= 0) {
|
||||||
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
err = SSL_get_error((SSL *)((ssl_conn*)sslq->conn)->ssl, res);
|
||||||
if (err == SSL_ERROR_WANT_READ) {
|
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
|
||||||
|
sslq->rwant = (err == SSL_ERROR_WANT_WRITE)? POLLOUT : POLLIN;
|
||||||
seterrno3(EAGAIN);
|
seterrno3(EAGAIN);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else seterrno3(err);
|
else seterrno3(err);
|
||||||
}
|
}
|
||||||
|
else sslq->rwant = 0;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,6 +248,8 @@ static int ssl_poll(void *state, struct pollfd *fds, nfds_t nfds, int timeout){
|
|||||||
struct SSLsock *sslq = NULL;
|
struct SSLsock *sslq = NULL;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
short own[64], *events = own, ev;
|
||||||
|
|
||||||
for(i = 0; i < nfds; i++){
|
for(i = 0; i < nfds; i++){
|
||||||
if((fds[i].events & POLLIN) && (sslq = searchSSL(state, fds[i].fd)) && ssl_pending(sslq->conn)){
|
if((fds[i].events & POLLIN) && (sslq = searchSSL(state, fds[i].fd)) && ssl_pending(sslq->conn)){
|
||||||
fds[i].revents = POLLIN;
|
fds[i].revents = POLLIN;
|
||||||
@@ -243,8 +258,29 @@ static int ssl_poll(void *state, struct pollfd *fds, nfds_t nfds, int timeout){
|
|||||||
else fds[i].revents = 0;
|
else fds[i].revents = 0;
|
||||||
}
|
}
|
||||||
if(ret) return ret;
|
if(ret) return ret;
|
||||||
|
for(i = 0; i < nfds; i++) if((sslq = searchSSL(state, fds[i].fd)) && (sslq->rwant || sslq->wwant)) break;
|
||||||
|
if(i == nfds) return sso._poll(state, fds, nfds, timeout);
|
||||||
|
|
||||||
|
/* A read or a write TLS could not do waits for what TLS needs, a read
|
||||||
|
for the socket to be writable: whatever that gets is the caller's
|
||||||
|
chance to try again, revents what it asked for, and its events are
|
||||||
|
given back as they were. */
|
||||||
|
if(nfds > sizeof(own)/sizeof(own[0]) && !(events = malloc(nfds * sizeof(*events)))) return -1;
|
||||||
|
for(i = 0; i < nfds; i++){
|
||||||
|
events[i] = fds[i].events;
|
||||||
|
if(!(sslq = searchSSL(state, fds[i].fd))) continue;
|
||||||
|
ev = fds[i].events & ~(POLLIN|POLLOUT);
|
||||||
|
if(fds[i].events & POLLIN) ev |= sslq->rwant? sslq->rwant : POLLIN;
|
||||||
|
if(fds[i].events & POLLOUT) ev |= sslq->wwant? sslq->wwant : POLLOUT;
|
||||||
|
fds[i].events = ev;
|
||||||
|
}
|
||||||
ret = sso._poll(state, fds, nfds, timeout);
|
ret = sso._poll(state, fds, nfds, timeout);
|
||||||
|
for(i = 0; i < nfds; i++){
|
||||||
|
if(ret > 0 && fds[i].events != events[i] && (fds[i].revents & ~(POLLERR|POLLHUP|POLLNVAL)))
|
||||||
|
fds[i].revents = events[i] | (fds[i].revents & (POLLERR|POLLHUP|POLLNVAL));
|
||||||
|
fds[i].events = events[i];
|
||||||
|
}
|
||||||
|
if(events != own) free(events);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -779,7 +815,7 @@ static FILTER_ACTION ssl_filter_client(void *fo, struct clientparam * param, voi
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FILTER_ACTION ssl_filter_connect(void *fc, struct clientparam * param){
|
static FILTER_ACTION ssl_filter_connect(void *fc, struct clientparam * param){
|
||||||
if(PCONF->cli && !client_mode) {
|
if(PCONF->cli && !PCONF->client_mode) {
|
||||||
if(docli(param)) {
|
if(docli(param)) {
|
||||||
return REJECT;
|
return REJECT;
|
||||||
}
|
}
|
||||||
@@ -788,7 +824,7 @@ static FILTER_ACTION ssl_filter_connect(void *fc, struct clientparam * param){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FILTER_ACTION ssl_filter_afterauth(void *fc, struct clientparam * param){
|
static FILTER_ACTION ssl_filter_afterauth(void *fc, struct clientparam * param){
|
||||||
if(PCONF->cli && client_mode == 1) {
|
if(PCONF->cli && PCONF->client_mode == 1) {
|
||||||
if(docli(param)) {
|
if(docli(param)) {
|
||||||
return REJECT;
|
return REJECT;
|
||||||
}
|
}
|
||||||
@@ -806,7 +842,7 @@ static FILTER_ACTION ssl_filter_predata(void *fc, struct clientparam * param){
|
|||||||
if(!param->redirectfunc) param->redirectfunc = proxyfunc;
|
if(!param->redirectfunc) param->redirectfunc = proxyfunc;
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
else if(PCONF->cli && client_mode == 2) {
|
else if(PCONF->cli && PCONF->client_mode == 2) {
|
||||||
if(docli(param)) {
|
if(docli(param)) {
|
||||||
return REJECT;
|
return REJECT;
|
||||||
}
|
}
|
||||||
@@ -815,7 +851,7 @@ static FILTER_ACTION ssl_filter_predata(void *fc, struct clientparam * param){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static FILTER_ACTION ssl_parent(struct clientparam * param){
|
static FILTER_ACTION ssl_parent(struct clientparam * param){
|
||||||
if(PCONF->cli && client_mode == 3) {
|
if(PCONF->cli && PCONF->client_mode == 3) {
|
||||||
if(docli(param)) {
|
if(docli(param)) {
|
||||||
return REJECT;
|
return REJECT;
|
||||||
}
|
}
|
||||||
@@ -867,6 +903,9 @@ static void ssl_filter_close(void *fo){
|
|||||||
free(CONFIG->client_ca_file);
|
free(CONFIG->client_ca_file);
|
||||||
free(CONFIG->client_ca_dir);
|
free(CONFIG->client_ca_dir);
|
||||||
free(CONFIG->client_ca_store);
|
free(CONFIG->client_ca_store);
|
||||||
|
free(CONFIG->server_ca_file);
|
||||||
|
free(CONFIG->server_ca_dir);
|
||||||
|
free(CONFIG->server_ca_store);
|
||||||
free(CONFIG->client_sni);
|
free(CONFIG->client_sni);
|
||||||
if(CONFIG->client_alpn_protos.protos_len){
|
if(CONFIG->client_alpn_protos.protos_len){
|
||||||
free(CONFIG->client_alpn_protos.protos);
|
free(CONFIG->client_alpn_protos.protos);
|
||||||
|
|||||||
+52
-6
@@ -22,6 +22,7 @@
|
|||||||
#include <wolfssl/openssl/pem.h>
|
#include <wolfssl/openssl/pem.h>
|
||||||
#include <wolfssl/openssl/ssl.h>
|
#include <wolfssl/openssl/ssl.h>
|
||||||
#include <wolfssl/openssl/err.h>
|
#include <wolfssl/openssl/err.h>
|
||||||
|
#include <wolfssl/openssl/bn.h>
|
||||||
#else
|
#else
|
||||||
#include <openssl/crypto.h>
|
#include <openssl/crypto.h>
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
#include <openssl/bn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
@@ -84,7 +86,11 @@ static int copy_ext(X509 *dst_cert, X509 *src_cert, int nid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WITH_WOLFSSL
|
#ifndef WITH_WOLFSSL
|
||||||
static int add_ext(X509 *cert, int nid, const char *value)
|
/* issuer is the certificate the extension should describe as the issuer,
|
||||||
|
* which matters for an authority key identifier: it names the key that
|
||||||
|
* signs, not the key being signed.
|
||||||
|
*/
|
||||||
|
static int add_ext_issuer(X509 *cert, X509 *issuer, int nid, const char *value)
|
||||||
{
|
{
|
||||||
X509_EXTENSION *ex;
|
X509_EXTENSION *ex;
|
||||||
X509V3_CTX ctx;
|
X509V3_CTX ctx;
|
||||||
@@ -92,10 +98,8 @@ static int add_ext(X509 *cert, int nid, const char *value)
|
|||||||
/* This sets the 'context' of the extensions. */
|
/* This sets the 'context' of the extensions. */
|
||||||
/* No configuration database */
|
/* No configuration database */
|
||||||
X509V3_set_ctx_nodb(&ctx);
|
X509V3_set_ctx_nodb(&ctx);
|
||||||
/* Issuer and subject certs: both the target since it is self signed,
|
/* No request and no CRL */
|
||||||
* no request and no CRL
|
X509V3_set_ctx(&ctx, issuer, cert, NULL, NULL, 0);
|
||||||
*/
|
|
||||||
X509V3_set_ctx(&ctx, cert, cert, NULL, NULL, 0);
|
|
||||||
/* value is char * prior to OpenSSL 1.1.0 */
|
/* value is char * prior to OpenSSL 1.1.0 */
|
||||||
ex = X509V3_EXT_conf_nid(NULL, &ctx, nid, (char *)value);
|
ex = X509V3_EXT_conf_nid(NULL, &ctx, nid, (char *)value);
|
||||||
if (!ex)
|
if (!ex)
|
||||||
@@ -105,8 +109,39 @@ static int add_ext(X509 *cert, int nid, const char *value)
|
|||||||
X509_EXTENSION_free(ex);
|
X509_EXTENSION_free(ex);
|
||||||
return err > 0;
|
return err > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int add_ext(X509 *cert, int nid, const char *value)
|
||||||
|
{
|
||||||
|
/* Issuer and subject: both the target, for a self signed certificate */
|
||||||
|
return add_ext_issuer(cert, cert, nid, value);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* A serial number of the copy's own, when the source's cannot be set back:
|
||||||
|
* positive, from the hash of the source certificate, so the same for the
|
||||||
|
* same certificate and different for another. wolfSSL built with
|
||||||
|
* WOLFSSL_QT, as Ubuntu 26.04 has it, returns a serial number without the
|
||||||
|
* ASN.1 header its own X509_set_serialNumber() requires.
|
||||||
|
*/
|
||||||
|
static int set_serial_hash(X509 *cert, const unsigned char *hash)
|
||||||
|
{
|
||||||
|
unsigned char serial[16];
|
||||||
|
BIGNUM *bn;
|
||||||
|
ASN1_INTEGER *ai;
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
|
memcpy(serial, hash, sizeof(serial));
|
||||||
|
serial[0] &= 0x7f;
|
||||||
|
if(!serial[0]) serial[0] = 1;
|
||||||
|
if(!(bn = BN_bin2bn(serial, sizeof(serial), NULL))) return 0;
|
||||||
|
if((ai = BN_to_ASN1_INTEGER(bn, NULL))){
|
||||||
|
res = X509_set_serialNumber(cert, ai);
|
||||||
|
ASN1_INTEGER_free(ai);
|
||||||
|
}
|
||||||
|
BN_free(bn);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
SSL_CERT ssl_copy_cert(SSL_CERT cert, SSL_CONFIG *config)
|
SSL_CERT ssl_copy_cert(SSL_CERT cert, SSL_CONFIG *config)
|
||||||
{
|
{
|
||||||
int err = -1;
|
int err = -1;
|
||||||
@@ -154,7 +189,8 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert, SSL_CONFIG *config)
|
|||||||
}
|
}
|
||||||
/* v3 is required, extensions are added below */
|
/* v3 is required, extensions are added below */
|
||||||
X509_set_version(dst_cert, 2);
|
X509_set_version(dst_cert, 2);
|
||||||
if(!X509_set_serialNumber(dst_cert, X509_get_serialNumber(src_cert))
|
if((!X509_set_serialNumber(dst_cert, X509_get_serialNumber(src_cert))
|
||||||
|
&& !set_serial_hash(dst_cert, hash_sha256))
|
||||||
|| !X509_set_subject_name(dst_cert, X509_get_subject_name(src_cert))
|
|| !X509_set_subject_name(dst_cert, X509_get_subject_name(src_cert))
|
||||||
|| !X509_set_issuer_name(dst_cert, X509_get_subject_name(config->CA_cert))){
|
|| !X509_set_issuer_name(dst_cert, X509_get_subject_name(config->CA_cert))){
|
||||||
X509_free(dst_cert);
|
X509_free(dst_cert);
|
||||||
@@ -199,6 +235,16 @@ SSL_CERT ssl_copy_cert(SSL_CERT cert, SSL_CONFIG *config)
|
|||||||
add_ext(dst_cert, NID_basic_constraints, "critical,CA:FALSE");
|
add_ext(dst_cert, NID_basic_constraints, "critical,CA:FALSE");
|
||||||
if(!copy_ext(dst_cert, src_cert, NID_ext_key_usage))
|
if(!copy_ext(dst_cert, src_cert, NID_ext_key_usage))
|
||||||
add_ext(dst_cert, NID_ext_key_usage, "serverAuth");
|
add_ext(dst_cert, NID_ext_key_usage, "serverAuth");
|
||||||
|
/* A verifier following RFC 5280 strictly looks for the issuer through a
|
||||||
|
* key identifier and refuses a certificate carrying none: OpenSSL does
|
||||||
|
* with x509_strict, and Python has since 3.13. The identifiers are
|
||||||
|
* generated rather than copied, so they name the CA signing here
|
||||||
|
* instead of the one that signed upstream. keyid,issuer keeps working
|
||||||
|
* when the CA certificate has no subject key identifier of its own.
|
||||||
|
*/
|
||||||
|
add_ext(dst_cert, NID_subject_key_identifier, "hash");
|
||||||
|
add_ext_issuer(dst_cert, config->CA_cert, NID_authority_key_identifier,
|
||||||
|
"keyid,issuer");
|
||||||
#else
|
#else
|
||||||
copy_ext(dst_cert, src_cert, NID_basic_constraints);
|
copy_ext(dst_cert, src_cert, NID_basic_constraints);
|
||||||
copy_ext(dst_cert, src_cert, NID_ext_key_usage);
|
copy_ext(dst_cert, src_cert, NID_ext_key_usage);
|
||||||
|
|||||||
+6
-1
@@ -105,6 +105,7 @@ int
|
|||||||
|
|
||||||
#ifdef WITH_UN
|
#ifdef WITH_UN
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ALLOW 0
|
#define ALLOW 0
|
||||||
@@ -152,7 +153,9 @@ int
|
|||||||
#define UN_SAADDR(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (unsigned char *)((struct sockaddr_un *)sa)->sun_path :
|
#define UN_SAADDR(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (unsigned char *)((struct sockaddr_un *)sa)->sun_path :
|
||||||
#define UN_SAADDRLEN(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (int)sizeof(((struct sockaddr_un *)sa)->sun_path) :
|
#define UN_SAADDRLEN(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (int)sizeof(((struct sockaddr_un *)sa)->sun_path) :
|
||||||
#define UN_SASOCK(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? PF_UNIX :
|
#define UN_SASOCK(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? PF_UNIX :
|
||||||
#define UN_SASIZE(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? sizeof(struct sockaddr_un) :
|
/* an abstract name (Linux) is its bytes after the leading 0, no more:
|
||||||
|
padded with zeros it would be another name */
|
||||||
|
#define UN_SASIZE(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (((struct sockaddr_un *)sa)->sun_path[0] || !((struct sockaddr_un *)sa)->sun_path[1]? sizeof(struct sockaddr_un) : offsetof(struct sockaddr_un, sun_path) + 1 + strlen(((struct sockaddr_un *)sa)->sun_path + 1)) :
|
||||||
#define UN_SAISNULL(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (((struct sockaddr_un *)sa)->sun_path[0] == 0 && ((struct sockaddr_un *)sa)->sun_path[1] == 0) :
|
#define UN_SAISNULL(sa) (((struct sockaddr_un *)sa)->sun_family == AF_UNIX)? (((struct sockaddr_un *)sa)->sun_path[0] == 0 && ((struct sockaddr_un *)sa)->sun_path[1] == 0) :
|
||||||
#else
|
#else
|
||||||
#define UN_SAPORT(sa)
|
#define UN_SAPORT(sa)
|
||||||
@@ -527,6 +530,8 @@ struct srvparam {
|
|||||||
AUTHFUNC authfunc;
|
AUTHFUNC authfunc;
|
||||||
PROXYFUNC pf;
|
PROXYFUNC pf;
|
||||||
SOCKET srvsock, cbsock;
|
SOCKET srvsock, cbsock;
|
||||||
|
/* the file of a Unix socket bound to a path, to remove only it */
|
||||||
|
uint64_t undev, unino;
|
||||||
int childcount;
|
int childcount;
|
||||||
int maxchild;
|
int maxchild;
|
||||||
int backlog;
|
int backlog;
|
||||||
|
|||||||
+12
-1
@@ -121,6 +121,11 @@ int udpbind(struct clientparam *param)
|
|||||||
fcntl(s, F_SETFL, O_NONBLOCK | fcntl(s, F_GETFL));
|
fcntl(s, F_SETFL, O_NONBLOCK | fcntl(s, F_GETFL));
|
||||||
#endif
|
#endif
|
||||||
param->remsock = s;
|
param->remsock = s;
|
||||||
|
if (extbindtodevice(param, param->remsock)) {
|
||||||
|
param->srv->so._closesocket(param->sostate, param->remsock);
|
||||||
|
param->remsock = INVALID_SOCKET;
|
||||||
|
return 12;
|
||||||
|
}
|
||||||
if (param->srv->so._bind(param->sostate, param->remsock,
|
if (param->srv->so._bind(param->sostate, param->remsock,
|
||||||
(struct sockaddr *)¶m->sinsl, SASIZE(¶m->sinsl))) {
|
(struct sockaddr *)¶m->sinsl, SASIZE(¶m->sinsl))) {
|
||||||
*SAPORT(¶m->sinsl) = 0;
|
*SAPORT(¶m->sinsl) = 0;
|
||||||
@@ -131,7 +136,7 @@ int udpbind(struct clientparam *param)
|
|||||||
return 12;
|
return 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sasize = SASIZE(¶m->sinsl);
|
sasize = sizeof(param->sinsl);
|
||||||
param->srv->so._getsockname(param->sostate, param->remsock,
|
param->srv->so._getsockname(param->sostate, param->remsock,
|
||||||
(struct sockaddr *)¶m->sinsl, &sasize);
|
(struct sockaddr *)¶m->sinsl, &sasize);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -284,6 +289,12 @@ int udpsockmap(struct clientparam *param, int timeo)
|
|||||||
}
|
}
|
||||||
default: return 997;
|
default: return 997;
|
||||||
}
|
}
|
||||||
|
/* As for TCP requests, a literal address is the host name,
|
||||||
|
otherwise an ACL with host names only matches any address */
|
||||||
|
if (!dstname) {
|
||||||
|
myinet_ntop(*SAFAMILY(&dst), SAADDR(&dst), dstnamebuf, sizeof(dstnamebuf));
|
||||||
|
dstname = dstnamebuf;
|
||||||
|
}
|
||||||
memcpy(SAPORT(&dst), base + i, 2);
|
memcpy(SAPORT(&dst), base + i, 2);
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -1,14 +1,14 @@
|
|||||||
#ifndef VERSION
|
#ifndef VERSION
|
||||||
#define VERSION "3proxy-1.0.0"
|
#define VERSION "3proxy-0.9.9.3"
|
||||||
#endif
|
#endif
|
||||||
#ifndef BUILDDATE
|
#ifndef BUILDDATE
|
||||||
#define BUILDDATE "260822121300"
|
#define BUILDDATE "261107091432"
|
||||||
#endif
|
#endif
|
||||||
#define MAJOR3PROXY 1
|
#define MAJOR3PROXY 0
|
||||||
#define SUBMAJOR3PROXY 0
|
#define SUBMAJOR3PROXY 9
|
||||||
#define MINOR3PROXY 0
|
#define MINOR3PROXY 9
|
||||||
#define SUBMINOR3PROXY 0
|
#define SUBMINOR3PROXY 3
|
||||||
#define RELEASE3PROXY "3proxy-1.0.0(" BUILDDATE ")\0"
|
#define RELEASE3PROXY "3proxy-0.9.9.3(" BUILDDATE ")\0"
|
||||||
#ifndef YEAR3PROXY
|
#ifndef YEAR3PROXY
|
||||||
#define YEAR3PROXY "2026"
|
#define YEAR3PROXY "2026"
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user