mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff3398c6a9 | ||
|
|
4fb5c95704 | ||
|
|
13a57812e5 | ||
|
|
a43c95023d | ||
|
|
75021a2003 | ||
|
|
bebc3894e2 | ||
|
|
ddb74a111c | ||
|
|
1e47e74c49 | ||
|
|
eca362af81 | ||
|
|
c31fe8367f | ||
|
|
f480c9dfe8 | ||
|
|
8de2be3b3b | ||
|
|
aea9ff8c94 | ||
|
|
e7bc76da73 | ||
|
|
207ddb7f02 | ||
|
|
f5ff81d0bc | ||
|
|
8c2ad56665 | ||
|
|
a986ed7a07 | ||
|
|
eceb5a22df | ||
|
|
7eba73fc8f | ||
|
|
122ca26249 | ||
|
|
6369fe966e | ||
|
|
cb27ca5223 | ||
|
|
932c4e3fd9 | ||
|
|
6818872f63 | ||
|
|
81a4e5bae3 | ||
|
|
0ae2754c1e | ||
|
|
05f83896bf | ||
|
|
f668a34910 | ||
|
|
763e21e053 | ||
|
|
7b85f6a684 | ||
|
|
92d3b08dd2 | ||
|
|
4877b39f2c | ||
|
|
44c47ee7d9 | ||
|
|
5f1ed7363b | ||
|
|
c370635fc4 | ||
|
|
3bfabb29f8 | ||
|
|
e4a5a7252c | ||
|
|
5f542a505a | ||
|
|
5b7446ba8f | ||
|
|
4af02c9268 | ||
|
|
ed5103d176 | ||
|
|
75dedeff28 | ||
|
|
c60af54c98 | ||
|
|
01f85cf755 | ||
|
|
305f9932ac | ||
|
|
c94766dff7 | ||
|
|
87fc8ae4ee | ||
|
|
9ab2e820b5 | ||
|
|
7798f78137 | ||
|
|
d60ac723a5 | ||
|
|
afb2ec0696 | ||
|
|
f18a751f89 | ||
|
|
8de071aa87 | ||
|
|
f173f8860d | ||
|
|
3a66c0a4c0 | ||
|
|
66ee250e5c | ||
|
|
c893e866bd | ||
|
|
fbc0953d5c | ||
|
|
37b1ab8169 | ||
|
|
b7769d05af | ||
|
|
fdda69c1f4 | ||
|
|
a757fae617 | ||
|
|
1c9577b9a9 | ||
|
|
b59c044663 | ||
|
|
de5acb2abd | ||
|
|
d6dea13a6f | ||
|
|
a04cd67eaa | ||
|
|
19cacf0bd9 | ||
|
|
27d5d8d102 | ||
|
|
6b944f3fa9 | ||
|
|
4f99443750 | ||
|
|
c462963d8e | ||
|
|
e41ab58b2c | ||
|
|
8f13582329 | ||
|
|
af9f23ece7 | ||
|
|
d77dc00fd1 | ||
|
|
101125de36 | ||
|
|
1dfe9e718b | ||
|
|
84879cc0ba | ||
|
|
757ad916ec | ||
|
|
fbc3ed5a18 | ||
|
|
69862b67cb | ||
|
|
fd7b25bf06 | ||
|
|
ab11e6c4a3 | ||
|
|
74d5b67ef4 | ||
|
|
6d8643b70e | ||
|
|
9e7246e864 | ||
|
|
c5affd2db4 | ||
|
|
794f667eea | ||
|
|
0259b58b95 | ||
|
|
9734b54f56 | ||
|
|
fe2b2fd544 | ||
|
|
086d4cbd6a | ||
|
|
2695d83847 | ||
|
|
dd5fe3994e | ||
|
|
5ab63a0b68 | ||
|
|
254112cfde | ||
|
|
5cae5dc866 | ||
|
|
56fdbd6e8a | ||
|
|
997671ee16 | ||
|
|
34e9c453fa | ||
|
|
3dde2de498 | ||
|
|
bdf9946fe5 | ||
|
|
eab5758b51 | ||
|
|
1772295a36 | ||
|
|
f0a672b16a | ||
|
|
01dad546b7 | ||
|
|
30aaccc155 | ||
|
|
2cb6297968 | ||
|
|
d66311a045 | ||
|
|
905e3d3152 | ||
|
|
7c08432a70 | ||
|
|
d4554cfabd | ||
|
|
1aecfa7995 | ||
|
|
289d2f5211 | ||
|
|
94efc7f7a6 | ||
|
|
d34c036eb7 | ||
|
|
4bf1f3990b | ||
|
|
a639bcb017 | ||
|
|
bed3977575 | ||
|
|
16af910f3a | ||
|
|
7c1bc48c85 | ||
|
|
05c4832c6c | ||
|
|
381ef993a7 | ||
|
|
1de06c5059 | ||
|
|
aaa04116a8 | ||
|
|
5fdd4a4d6f | ||
|
|
7871279fae | ||
|
|
ff15a8d480 | ||
|
|
95029e9e41 | ||
|
|
6286bfcd6e | ||
|
|
b1d21cbdca | ||
|
|
978f351560 | ||
|
|
41d1fa8b00 | ||
|
|
8c638fcaff | ||
|
|
6963af7614 | ||
|
|
f8c22d5f91 | ||
|
|
c104203765 | ||
|
|
45c3b89484 | ||
|
|
0d7f05b05b | ||
|
|
750bb38907 | ||
|
|
46cff56cf4 | ||
|
|
d0d3b90226 | ||
|
|
7a139e59a5 | ||
|
|
ff7f4b8ea6 | ||
|
|
ec48b7f30e | ||
|
|
88a09bc3ff | ||
|
|
0e13f57139 | ||
|
|
cbab76fe41 | ||
|
|
fb9337c030 | ||
|
|
ef9386e29d | ||
|
|
334de0658c | ||
|
|
ec469fa2a6 | ||
|
|
fbd1788f4c | ||
|
|
830b2d39d1 | ||
|
|
a338a0c689 | ||
|
|
af8a6e0b91 | ||
|
|
2997533287 | ||
|
|
5f06879843 | ||
|
|
da8a8615f4 | ||
|
|
51a82613a6 | ||
|
|
b87e998e4d | ||
|
|
4068a6955f | ||
|
|
07c1dc1462 | ||
|
|
acce67a512 | ||
|
|
e986f8a747 | ||
|
|
314503d8df | ||
|
|
8107f03062 | ||
|
|
a3fb7aff07 | ||
|
|
b1ac46da79 | ||
|
|
d125261e8c | ||
|
|
a4527783d6 | ||
|
|
fb70d06d3e | ||
|
|
57d687fcb8 | ||
|
|
ada24a98ec | ||
|
|
ba2584cebf | ||
|
|
05096c222a | ||
|
|
6c3c5f31a2 | ||
|
|
319a74de06 | ||
|
|
e088a5d7f9 | ||
|
|
f01c8bfee9 | ||
|
|
a7cdfa578d | ||
|
|
d52701518d | ||
|
|
7ddea44ffd | ||
|
|
760a521df8 | ||
|
|
62ceb36157 | ||
|
|
62be3c7b5b | ||
|
|
85c431b96e | ||
|
|
90c312f4cd | ||
|
|
451b3d180c | ||
|
|
f63a83f554 | ||
|
|
6b61cfde4c | ||
|
|
e6c3427cab | ||
|
|
4f0f3c81e1 | ||
|
|
bfbbf1f446 | ||
|
|
b79906da02 | ||
|
|
68ef9dcc59 | ||
|
|
3957210609 | ||
|
|
ee00956b74 | ||
|
|
083a70393f | ||
|
|
d9b1493260 | ||
|
|
7102afe856 | ||
|
|
a3729354b8 | ||
|
|
45796f66c7 | ||
|
|
260cbf7a3d | ||
|
|
bba9871ed8 | ||
|
|
f1af44f3a9 | ||
|
|
4ee7f71fb9 | ||
|
|
98604b5421 | ||
|
|
a0d580b36d | ||
|
|
4c0e3a1bac | ||
|
|
454f5e1d54 | ||
|
|
c4ac696919 | ||
|
|
afbdad0ac7 | ||
|
|
a1a65c3fd5 | ||
|
|
2fd536781f | ||
|
|
878a432481 | ||
|
|
3f92dc7355 | ||
|
|
bae96b0823 | ||
|
|
f77f65ac4e | ||
|
|
2d6eeff5f3 | ||
|
|
c206349ee2 | ||
|
|
77b0dc3397 |
No files matched your search
@@ -0,0 +1,73 @@
|
|||||||
|
# Exclude top-level dirs not needed for build
|
||||||
|
/bin/
|
||||||
|
/bin64/
|
||||||
|
/build/
|
||||||
|
/cfg/
|
||||||
|
/cmake/
|
||||||
|
/CMakeFiles/
|
||||||
|
/debian/
|
||||||
|
/doc/
|
||||||
|
/man/
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
**/*.o
|
||||||
|
**/*.obj
|
||||||
|
**/*.so
|
||||||
|
**/*.dll
|
||||||
|
**/*.exe
|
||||||
|
**/*.exp
|
||||||
|
**/*.lib
|
||||||
|
**/*.pdb
|
||||||
|
**/*.ilk
|
||||||
|
**/*.idb
|
||||||
|
**/*.err
|
||||||
|
**/*.ld.so
|
||||||
|
**/*.dSYM
|
||||||
|
**/*.var
|
||||||
|
build*/
|
||||||
|
buildlinux.sh
|
||||||
|
tmp/
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Editor / IDE
|
||||||
|
**/*.swp
|
||||||
|
**/*.swo
|
||||||
|
**/*~
|
||||||
|
**/*.bak
|
||||||
|
**/*.tmp
|
||||||
|
**/*.log
|
||||||
|
.project
|
||||||
|
.cproject
|
||||||
|
.classpath
|
||||||
|
.settings/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Git
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
|
||||||
|
# Claude / docs
|
||||||
|
CLAUDE.md
|
||||||
|
.claude/
|
||||||
|
|
||||||
|
# Generated version files
|
||||||
|
version
|
||||||
|
version.c
|
||||||
|
version.sh
|
||||||
|
verfile.sh
|
||||||
|
|
||||||
|
# Local config / keys
|
||||||
|
**/*.key
|
||||||
|
**/*.pem
|
||||||
|
**/*.pfx
|
||||||
|
3proxy.cfg
|
||||||
|
3proxy-ssl.cfg
|
||||||
|
3proxy-pcre.cfg
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
res
|
||||||
|
3proxy.res
|
||||||
|
copytgz.sh
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: RPM/DEB build aarch64
|
name: RPM/DEB build aarch64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master", "test-ci" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-rpm-arm64.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,17 +17,14 @@ jobs:
|
|||||||
- ubuntu-24.04-arm
|
- ubuntu-24.04-arm
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
- name: env
|
- name: env
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
||||||
echo "MAJOR=$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV
|
|
||||||
echo "SUBMAJOR=$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV
|
|
||||||
echo "MINOR=$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV
|
|
||||||
- name: echo env
|
- name: echo env
|
||||||
run: echo "release $RELEASE version $VERSION major $MAJOR submajor $SUBMAJOR minor $MINOR"
|
run: echo "release $RELEASE version $VERSION"
|
||||||
- name: Linux libraries
|
- name: Linux libraries
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -44,11 +44,17 @@ jobs:
|
|||||||
rpmbuild -ba 3proxy-$RELEASE.spec
|
rpmbuild -ba 3proxy-$RELEASE.spec
|
||||||
cd $ret
|
cd $ret
|
||||||
mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm 3proxy-$RELEASE.arm64.rpm
|
mv ~/rpmbuild/RPMS/aarch64/3proxy-$RELEASE-1.aarch64.rpm 3proxy-$RELEASE.arm64.rpm
|
||||||
- name: Get artifact arp
|
- name: Get artifact rpm
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-arm64.rpm"
|
name: "3proxy-${{ env.RELEASE }}-arm64.rpm"
|
||||||
path: "*.rpm"
|
path: "*.rpm"
|
||||||
|
- name: Upload rpm to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.arm64.rpm
|
||||||
- name: debbuild
|
- name: debbuild
|
||||||
run: |
|
run: |
|
||||||
ret=`pwd`
|
ret=`pwd`
|
||||||
@@ -65,7 +71,13 @@ jobs:
|
|||||||
cd $ret
|
cd $ret
|
||||||
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_arm64.deb ./3proxy-$RELEASE.arm64.deb
|
||||||
- name: Get artifact deb
|
- name: Get artifact deb
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-arm64.deb"
|
name: "3proxy-${{ env.RELEASE }}-arm64.deb"
|
||||||
path: "*.deb"
|
path: "*.deb"
|
||||||
|
- name: Upload deb to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.arm64.deb
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: RPM/DEB build armhf
|
name: RPM/DEB build armhf
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master", "test-ci" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-rpm-armhf.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,15 +17,12 @@ jobs:
|
|||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
- name: env
|
- name: env
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
||||||
echo "MAJOR=$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV
|
|
||||||
echo "SUBMAJOR=$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV
|
|
||||||
echo "MINOR=$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV
|
|
||||||
- name: Linux libraries
|
- name: Linux libraries
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -68,14 +68,20 @@ jobs:
|
|||||||
export CC=$CC
|
export CC=$CC
|
||||||
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
|
export RPATH=/usr/arm-linux-gnueabihf/lib:$RPATH
|
||||||
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$LD_LIBRARY_PATH
|
||||||
rpmbuild -ba --define "PAMLIB pam0g" --define "_arch arm" --define "cross yes" --target=arm-linux-gnueabi 3proxy-$RELEASE.spec
|
rpmbuild -ba --define "PAMLIB pam0g" --define "_arch arm" --define "cross yes" --target=arm-linux-gnueabihf 3proxy-$RELEASE.spec
|
||||||
cd $ret
|
cd $ret
|
||||||
mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.arm.rpm
|
mv ~/rpmbuild/RPMS/arm/3proxy-$RELEASE-1.arm.rpm 3proxy-$RELEASE.arm.rpm
|
||||||
- name: Get artifact
|
- name: Get artifact rpm
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-arm.rpm"
|
name: "3proxy-${{ env.RELEASE }}-arm.rpm"
|
||||||
path: "*.rpm"
|
path: "*.rpm"
|
||||||
|
- name: Upload rpm to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.arm.rpm
|
||||||
- name: debbuild
|
- name: debbuild
|
||||||
run: |
|
run: |
|
||||||
ret=`pwd`
|
ret=`pwd`
|
||||||
@@ -98,7 +104,13 @@ jobs:
|
|||||||
cd $ret
|
cd $ret
|
||||||
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_armhf.deb ./3proxy-$RELEASE.arm.deb
|
||||||
- name: Get artifact deb
|
- name: Get artifact deb
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-arm.deb"
|
name: "3proxy-${{ env.RELEASE }}-arm.deb"
|
||||||
path: "*.deb"
|
path: "*.deb"
|
||||||
|
- name: Upload deb to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.arm.deb
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: RPM/DEB build x86-64
|
name: RPM/DEB build x86-64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master", "test-ci" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-rpm-x86-64.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,17 +17,14 @@ jobs:
|
|||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
- name: env
|
- name: env
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
echo "RELEASE=$(cat RELEASE)" >> $GITHUB_ENV
|
||||||
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
echo "VERSION=$(date +%y%m%d%H%M%S)" >> $GITHUB_ENV
|
||||||
echo "MAJOR=$(cat RELEASE | cut -d "-" -f 1)" >> $GITHUB_ENV
|
|
||||||
echo "SUBMAJOR=$(cat RELEASE | cut -d "-" -f 2)" >> $GITHUB_ENV
|
|
||||||
echo "MINOR=$(cat RELEASE | cut -d "-" -f 3)" >> $GITHUB_ENV
|
|
||||||
- name: echo env
|
- name: echo env
|
||||||
run: echo "release $RELEASE version $VERSION major $MAJOR submajor $SUBMAJOR minor $MINOR"
|
run: echo "release $RELEASE version $VERSION"
|
||||||
- name: Linux libraries
|
- name: Linux libraries
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
@@ -45,10 +45,16 @@ jobs:
|
|||||||
cd $ret
|
cd $ret
|
||||||
mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm 3proxy-$RELEASE.x86_64.rpm
|
mv ~/rpmbuild/RPMS/x86_64/3proxy-$RELEASE-1.x86_64.rpm 3proxy-$RELEASE.x86_64.rpm
|
||||||
- name: Get artifact rpm
|
- name: Get artifact rpm
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-x86_64.rpm"
|
name: "3proxy-${{ env.RELEASE }}-x86_64.rpm"
|
||||||
path: "*.rpm"
|
path: "*.rpm"
|
||||||
|
- name: Upload rpm to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.x86_64.rpm
|
||||||
- name: debbuild
|
- name: debbuild
|
||||||
run: |
|
run: |
|
||||||
ret=`pwd`
|
ret=`pwd`
|
||||||
@@ -65,8 +71,14 @@ jobs:
|
|||||||
cd $ret
|
cd $ret
|
||||||
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
|
cp ~/debian/3proxy_$RELEASE-"$VERSION"_amd64.deb ./3proxy-$RELEASE.x86_64.deb
|
||||||
- name: Get artifact deb
|
- name: Get artifact deb
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-x86_64.deb"
|
name: "3proxy-${{ env.RELEASE }}-x86_64.deb"
|
||||||
path: "*.deb"
|
path: "*.deb"
|
||||||
|
- name: Upload deb to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}.x86_64.deb
|
||||||
|
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: Build Win32 3proxy-lite with Watcom
|
name: Build Win32 3proxy-lite with Watcom
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-watcom.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,11 +17,11 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: Setup Open Watcom
|
- name: Setup Open Watcom
|
||||||
uses: open-watcom/setup-watcom@v0
|
uses: open-watcom/setup-watcom@v1
|
||||||
- name: set date
|
- name: set date
|
||||||
run: |
|
run: |
|
||||||
$NOW = Get-Date -Format "yyMMddHHmmss"
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
@@ -33,6 +36,17 @@ jobs:
|
|||||||
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\nCode certificate: https://3proxy.org/3proxy.cer\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: |
|
||||||
@@ -45,26 +59,37 @@ jobs:
|
|||||||
mkdir dist\3proxy\doc\ru
|
mkdir dist\3proxy\doc\ru
|
||||||
mkdir dist\3proxy\doc\html
|
mkdir dist\3proxy\doc\html
|
||||||
mkdir dist\3proxy\doc\html\plugins
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
mkdir dist\3proxy\doc\html\man3
|
mkdir dist\3proxy\doc\html\man5
|
||||||
mkdir dist\3proxy\doc\html\man8
|
mkdir dist\3proxy\doc\html\man8
|
||||||
mkdir dist\3proxy\doc\devel
|
mkdir dist\3proxy\doc\html\devel
|
||||||
copy bin\3proxy.exe dist\3proxy\bin\
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
copy bin\*.dll dist\3proxy\bin\
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
copy bin\mycrypt.exe dist\3proxy\bin\
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
copy cfg\*.* dist\3proxy\cfg\
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
copy doc\ru\*.* dist\3proxy\doc\ru\
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
copy doc\html\*.* dist\3proxy\doc\html\
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
copy doc\html\man3\*.* dist\3proxy\doc\html\man3\
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
copy doc\devel\*.rtf dist\3proxy\doc\devel\
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
copy copying dist\3proxy\
|
copy copying dist\3proxy\
|
||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README dist\3proxy\
|
copy README.md dist\3proxy\
|
||||||
copy rus.3ps dist\3proxy\
|
copy rus.3ps dist\3proxy\
|
||||||
- name: Get artifact
|
- name: Get artifact
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-lite"
|
name: "3proxy-${{ env.RELEASE }}-lite"
|
||||||
path: dist/
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-lite.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}-lite.zip
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
name: Build 3proxy with MSYS2 UCRT64
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: "msys2-ucrt64"
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Setup MSYS2 (UCRT64)
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
msystem: UCRT64
|
||||||
|
update: true
|
||||||
|
install: >-
|
||||||
|
make
|
||||||
|
mingw-w64-ucrt-x86_64-gcc
|
||||||
|
mingw-w64-ucrt-x86_64-pcre2
|
||||||
|
mingw-w64-ucrt-x86_64-openssl
|
||||||
|
mingw-w64-ucrt-x86_64-zlib
|
||||||
|
- name: set date
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$NOW = Get-Date -Format "yyMMddHHmmss"
|
||||||
|
$RELEASE = Get-Content -Path "RELEASE" -Raw
|
||||||
|
echo "NOW=$NOW" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
echo "RELEASE=$RELEASE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
|
- name: make Windows (Makefile.win)
|
||||||
|
shell: msys2 {0}
|
||||||
|
env:
|
||||||
|
LIBSTATIC: 'true'
|
||||||
|
run: make -f Makefile.win
|
||||||
|
- name: make dist dir
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
mkdir dist\3proxy
|
||||||
|
mkdir dist\3proxy\bin
|
||||||
|
mkdir dist\3proxy\cfg
|
||||||
|
mkdir dist\3proxy\cfg\sql
|
||||||
|
mkdir dist\3proxy\doc
|
||||||
|
mkdir dist\3proxy\doc\ru
|
||||||
|
mkdir dist\3proxy\doc\html
|
||||||
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
|
mkdir dist\3proxy\doc\html\man5
|
||||||
|
mkdir dist\3proxy\doc\html\man8
|
||||||
|
mkdir dist\3proxy\doc\html\devel
|
||||||
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
|
copy copying dist\3proxy\
|
||||||
|
copy authors dist\3proxy\
|
||||||
|
copy README.md dist\3proxy\
|
||||||
|
copy rus.3ps dist\3proxy\
|
||||||
|
- name: Get artifact
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
name: "3proxy-${{ env.RELEASE }}-msys2-ucrt64"
|
||||||
|
path: dist/
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: Build Win32 3proxy with MSVC
|
name: Build Win32 3proxy with MSVC
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-win32.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,7 +17,7 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: set date
|
- name: set date
|
||||||
@@ -25,7 +28,7 @@ jobs:
|
|||||||
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
- name: install packages
|
- name: install packages
|
||||||
run: vcpkg install pcre2:x86-windows-static openssl:x86-windows-static
|
run: vcpkg install pcre2:x86-windows-static wolfssl:x86-windows-static
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v3
|
uses: microsoft/setup-msbuild@v3
|
||||||
- name: make Windows MSVC
|
- name: make Windows MSVC
|
||||||
@@ -38,7 +41,26 @@ jobs:
|
|||||||
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\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
|
||||||
nmake /F Makefile.msvc
|
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: |
|
||||||
@@ -51,26 +73,38 @@ jobs:
|
|||||||
mkdir dist\3proxy\doc\ru
|
mkdir dist\3proxy\doc\ru
|
||||||
mkdir dist\3proxy\doc\html
|
mkdir dist\3proxy\doc\html
|
||||||
mkdir dist\3proxy\doc\html\plugins
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
mkdir dist\3proxy\doc\html\man3
|
mkdir dist\3proxy\doc\html\man5
|
||||||
mkdir dist\3proxy\doc\html\man8
|
mkdir dist\3proxy\doc\html\man8
|
||||||
mkdir dist\3proxy\doc\devel
|
mkdir dist\3proxy\doc\html\devel
|
||||||
copy bin\3proxy.exe dist\3proxy\bin\
|
copy bin\3proxy.exe dist\3proxy\bin\
|
||||||
copy bin\*.dll dist\3proxy\bin\
|
copy bin\*.dll dist\3proxy\bin\
|
||||||
copy bin\mycrypt.exe dist\3proxy\bin\
|
copy bin\3proxy_crypt.exe dist\3proxy\bin\
|
||||||
copy cfg\*.* dist\3proxy\cfg\
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
copy doc\ru\*.* dist\3proxy\doc\ru\
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
copy doc\html\*.* dist\3proxy\doc\html\
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
copy doc\html\man3\*.* dist\3proxy\doc\html\man3\
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
copy doc\devel\*.rtf dist\3proxy\doc\devel\
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
copy copying dist\3proxy\
|
copy copying dist\3proxy\
|
||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README 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@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}"
|
name: "3proxy-${{ env.RELEASE }}-x86"
|
||||||
path: dist/
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-x86.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}-x86.zip
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: Build Win64 3proxy with MSVC
|
name: Build Win64 3proxy with MSVC
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-win64.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,7 +17,7 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: set date
|
- name: set date
|
||||||
@@ -26,11 +29,10 @@ jobs:
|
|||||||
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
- name: install packages
|
- name: install packages
|
||||||
run: vcpkg install pcre2:x64-windows-static openssl:x64-windows-static
|
run: vcpkg install pcre2:x64-windows-static wolfssl:x64-windows-static
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v3
|
uses: microsoft/setup-msbuild@v3
|
||||||
- name: make Windows MSVC
|
- name: make Windows MSVC
|
||||||
if: ${{ startsWith(matrix.target, 'windows') }}
|
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
@@ -40,7 +42,26 @@ jobs:
|
|||||||
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\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
|
||||||
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
echo %NOW% / %RELEASE% / %BUILDDATE% / %VERSION%
|
||||||
nmake /F Makefile.msvc
|
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: |
|
||||||
@@ -53,26 +74,38 @@ jobs:
|
|||||||
mkdir dist\3proxy\doc\ru
|
mkdir dist\3proxy\doc\ru
|
||||||
mkdir dist\3proxy\doc\html
|
mkdir dist\3proxy\doc\html
|
||||||
mkdir dist\3proxy\doc\html\plugins
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
mkdir dist\3proxy\doc\html\man3
|
mkdir dist\3proxy\doc\html\man5
|
||||||
mkdir dist\3proxy\doc\html\man8
|
mkdir dist\3proxy\doc\html\man8
|
||||||
mkdir dist\3proxy\doc\devel
|
mkdir dist\3proxy\doc\html\devel
|
||||||
copy bin\3proxy.exe dist\3proxy\bin64\
|
copy bin\3proxy.exe dist\3proxy\bin64\
|
||||||
copy bin\*.dll dist\3proxy\bin64\
|
copy bin\*.dll dist\3proxy\bin64\
|
||||||
copy bin\mycrypt.exe dist\3proxy\bin64\
|
copy bin\3proxy_crypt.exe dist\3proxy\bin64\
|
||||||
copy cfg\*.* dist\3proxy\cfg\
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
copy doc\ru\*.* dist\3proxy\doc\ru\
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
copy doc\html\*.* dist\3proxy\doc\html\
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
copy doc\html\man3\*.* dist\3proxy\doc\html\man3\
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
copy doc\devel\*.rtf dist\3proxy\doc\devel\
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
copy copying dist\3proxy\
|
copy copying dist\3proxy\
|
||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README 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@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-x64"
|
name: "3proxy-${{ env.RELEASE }}-x64"
|
||||||
path: dist/
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-x64.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}-x64.zip
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
name: Build Win-arm64 3proxy with MSVC
|
name: Build Win-arm64 3proxy with MSVC
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
branches: [ "master" ]
|
types: [published]
|
||||||
paths: [ 'RELEASE', '.github/workflows/build-winarm64.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -14,7 +17,7 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: set date
|
- name: set date
|
||||||
@@ -25,7 +28,7 @@ jobs:
|
|||||||
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "VERSION=/D `"VERSION=\`"3proxy-$RELEASE\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "BUILDDATE=/D `"BUILDDATE=\`"$NOW\`"`"" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
- name: install packages
|
- name: install packages
|
||||||
run: vcpkg install pcre2:arm64-windows-static openssl:arm64-windows-static
|
run: vcpkg install pcre2:arm64-windows-static wolfssl:arm64-windows-static
|
||||||
- name: Add msbuild to PATH
|
- name: Add msbuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v3
|
uses: microsoft/setup-msbuild@v3
|
||||||
- name: make Windows MSVC
|
- name: make Windows MSVC
|
||||||
@@ -38,7 +41,26 @@ jobs:
|
|||||||
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\nCode certificate: https://3proxy.org/3proxy.cer\r\n^";" >>src/3proxy.c
|
||||||
nmake /F Makefile.msvc
|
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: |
|
||||||
@@ -51,26 +73,38 @@ jobs:
|
|||||||
mkdir dist\3proxy\doc\ru
|
mkdir dist\3proxy\doc\ru
|
||||||
mkdir dist\3proxy\doc\html
|
mkdir dist\3proxy\doc\html
|
||||||
mkdir dist\3proxy\doc\html\plugins
|
mkdir dist\3proxy\doc\html\plugins
|
||||||
mkdir dist\3proxy\doc\html\man3
|
mkdir dist\3proxy\doc\html\man5
|
||||||
mkdir dist\3proxy\doc\html\man8
|
mkdir dist\3proxy\doc\html\man8
|
||||||
mkdir dist\3proxy\doc\devel
|
mkdir dist\3proxy\doc\html\devel
|
||||||
copy bin\3proxy.exe dist\3proxy\bin64\
|
copy bin\3proxy.exe dist\3proxy\bin64\
|
||||||
copy bin\*.dll dist\3proxy\bin64\
|
copy bin\*.dll dist\3proxy\bin64\
|
||||||
copy bin\mycrypt.exe dist\3proxy\bin64\
|
copy bin\3proxy_crypt.exe dist\3proxy\bin64\
|
||||||
copy cfg\*.* dist\3proxy\cfg\
|
copy cfg\*.* dist\3proxy\cfg\
|
||||||
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
copy cfg\sql\*.* dist\3proxy\cfg\sql\
|
||||||
copy doc\ru\*.* dist\3proxy\doc\ru\
|
copy doc\ru\*.* dist\3proxy\doc\ru\
|
||||||
copy doc\html\*.* dist\3proxy\doc\html\
|
copy doc\html\*.* dist\3proxy\doc\html\
|
||||||
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
copy doc\html\plugins\*.* dist\3proxy\doc\html\plugins\
|
||||||
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
copy doc\html\man8\*.* dist\3proxy\doc\html\man8\
|
||||||
copy doc\html\man3\*.* dist\3proxy\doc\html\man3\
|
copy doc\html\man5\*.* dist\3proxy\doc\html\man5\
|
||||||
copy doc\devel\*.rtf dist\3proxy\doc\devel\
|
copy doc\html\devel\*.* dist\3proxy\doc\html\devel\
|
||||||
copy copying dist\3proxy\
|
copy copying dist\3proxy\
|
||||||
copy authors dist\3proxy\
|
copy authors dist\3proxy\
|
||||||
copy README 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@v6
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: "3proxy-${{ env.RELEASE }}-arm64"
|
name: "3proxy-${{ env.RELEASE }}-arm64"
|
||||||
path: dist/
|
path: dist/
|
||||||
|
- name: Create zip
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: pwsh
|
||||||
|
run: Compress-Archive -Path dist/* -DestinationPath 3proxy-${{ env.RELEASE }}-arm64.zip
|
||||||
|
- name: Upload to release
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" 3proxy-${{ env.RELEASE }}-arm64.zip
|
||||||
@@ -2,11 +2,13 @@ name: C/C++ CI Linux
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
paths: [ '**.c', '**.h', 'Makefile.Linux', '.github/configs', '.github/workflows/c-cpp-Linux.yml' ]
|
paths: [ '**.c', '**.h', 'Makefile.Linux', '.github/configs', '.github/workflows/c-cpp-Linux.yml' ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
paths: [ "**.c", "**.h", "Makefile.Linux", ".github/configs", ".github/workflows/c-cpp-Linux.yml" ]
|
||||||
paths: [ '**.c', '**.h', 'Makefile.Linux', '.github/configs', '.github/workflows/c-cpp-Linux.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -18,12 +20,12 @@ jobs:
|
|||||||
- ubuntu-24.04-arm
|
- ubuntu-24.04-arm
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: Linux libraries
|
- name: Linux libraries
|
||||||
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
||||||
run: sudo apt install libssl-dev libpam-dev libpcre2-dev
|
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpam-dev libpcre2-dev
|
||||||
- name: make
|
- name: make
|
||||||
run: make -f Makefile.Linux
|
run: make -f Makefile.Linux
|
||||||
- name: mkdir
|
- name: mkdir
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ name: C/C++ CI MacOS
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
paths: [ '**.c', '**.h', 'Makefile.FreeBSD', '.github/configs', '.github/workflows/c-cpp-MacOS.yml' ]
|
paths: [ '**.c', '**.h', 'Makefile.FreeBSD', '.github/configs', '.github/workflows/c-cpp-MacOS.yml' ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
paths: [ "**.c", "**.h", "Makefile.FreeBSD", ".github/configs", ".github/workflows/c-cpp-MacOS.yml" ]
|
||||||
paths: [ '**.c', '**.h', 'Makefile.FreeBSD', '.github/configs', '.github/workflows/c-cpp-MacOS.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -17,7 +19,7 @@ jobs:
|
|||||||
- macos-15
|
- macos-15
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: Mac libraries
|
- name: Mac libraries
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ name: C/C++ CI Windows
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
paths: [ '**.c', '**.h', 'Makefile.msvc', '.github/configs', '.github/workflows/c-cpp-Windows.yml' ]
|
paths: [ '**.c', '**.h', 'Makefile.msvc', '.github/configs', '.github/workflows/c-cpp-Windows.yml' ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
paths: [ "**.c", "**.h", "Makefile.msvc", ".github/configs", ".github/workflows/c-cpp-Windows.yml" ]
|
||||||
paths: [ '**.c', '**.h', 'Makefile.msvc', '.github/configs', '.github/workflows/c-cpp-Windows.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -17,9 +19,9 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
- name: install Windows libraries
|
- name: install Windows libraries
|
||||||
run: vcpkg install pcre2:x64-windows && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-openssl
|
run: vcpkg install pcre2:x64-windows wolfssl:x64-windows-static && c:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 mingw-w64-x86_64-wolfssl
|
||||||
- name: make Windows
|
- name: make Windows
|
||||||
run: make -f Makefile.win
|
run: make -f Makefile.win
|
||||||
env:
|
env:
|
||||||
@@ -35,7 +37,7 @@ jobs:
|
|||||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
D:
|
D:
|
||||||
cd "D:/a/3proxy/3proxy"
|
cd "D:/a/3proxy/3proxy"
|
||||||
set "LIB=%LIB%;c:/program files/openssl/lib/VC/x64/MT;c:/vcpkg/installed/x64-windows/lib"
|
set "LIB=%LIB%;c:/vcpkg/installed/x64-windows-static/lib;c:/vcpkg/installed/x64-windows/lib"
|
||||||
set "INCLUDE=%INCLUDE%;c:/program files/openssl/include;c:/vcpkg/installed/x64-windows/include"
|
set "INCLUDE=%INCLUDE%;c:/vcpkg/installed/x64-windows-static/include;c:/vcpkg/installed/x64-windows/include"
|
||||||
nmake /F Makefile.msvc
|
nmake /F Makefile.msvc WOLFSSL=1 || exit /b 1
|
||||||
nmake /F Makefile.msvc clean
|
nmake /F Makefile.msvc clean
|
||||||
@@ -2,11 +2,13 @@ name: C/C++ CI cmake
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
|
||||||
paths: [ '**.c', '**.h', '**.cmake', 'CMakeLists.txt', '.github/configs', '.github/workflows/c-cpp-cmake.yml' ]
|
paths: [ '**.c', '**.h', '**.cmake', 'CMakeLists.txt', '.github/configs', '.github/workflows/c-cpp-cmake.yml' ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
paths: [ "**.c", "**.h", "**.cmake", "CMakeLists.txt", ".github/configs", ".github/workflows/c-cpp-cmake.yml" ]
|
||||||
paths: [ '**.c', '**.h', '**.cmake', 'CMakeLists.txt', '.github/configs', '.github/workflows/c-cpp-cmake.yml' ]
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
@@ -20,12 +22,12 @@ jobs:
|
|||||||
- windows-2022
|
- windows-2022
|
||||||
runs-on: ${{ matrix.target }}
|
runs-on: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v7
|
||||||
# - name: configure
|
# - name: configure
|
||||||
# run: ./configure
|
# run: ./configure
|
||||||
- name: Linux libraries
|
- name: Linux libraries
|
||||||
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
if: ${{ startsWith(matrix.target, 'ubuntu') }}
|
||||||
run: sudo apt install libssl-dev libpam-dev libpcre2-dev
|
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpam-dev libpcre2-dev
|
||||||
- name: Mac libraries
|
- name: Mac libraries
|
||||||
if: ${{ startsWith(matrix.target, 'macos') }}
|
if: ${{ startsWith(matrix.target, 'macos') }}
|
||||||
run: brew install pcre2
|
run: brew install pcre2
|
||||||
@@ -55,3 +57,18 @@ jobs:
|
|||||||
cmake --build .
|
cmake --build .
|
||||||
cd ..
|
cd ..
|
||||||
rmdir /s /q build
|
rmdir /s /q build
|
||||||
|
|
||||||
|
wolfssl:
|
||||||
|
name: "ubuntu-latest (wolfSSL)"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- name: Install wolfSSL
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libwolfssl-dev
|
||||||
|
- name: make with CMake (wolfSSL preferred)
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
cd .. && rm -rf build/
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
name: Build Docker images (GHCR)
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build and push Docker images
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Determine tags
|
||||||
|
id: tags
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
IMAGE: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
run: |
|
||||||
|
if [[ "$RELEASE_TAG" != "" ]]; then
|
||||||
|
RELEASE="${RELEASE_TAG#v}"
|
||||||
|
echo "minimal=${IMAGE}:${RELEASE}.minimal,${IMAGE}:minimal" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "busybox=${IMAGE}:${RELEASE}.busybox,${IMAGE}:busybox" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "full=${IMAGE}:${RELEASE},${IMAGE}:latest" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
DATETIME=$(date +%d%m%y%H%M%S)
|
||||||
|
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr "/" "-")
|
||||||
|
echo "minimal=${IMAGE}:${DATETIME}-${BRANCH}.minimal,${IMAGE}:${BRANCH}.minimal" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "busybox=${IMAGE}:${DATETIME}-${BRANCH}.busybox,${IMAGE}:${BRANCH}.busybox" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "full=${IMAGE}:${DATETIME}-${BRANCH},${IMAGE}:${BRANCH}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Install cosign
|
||||||
|
uses: sigstore/cosign-installer@v3
|
||||||
|
|
||||||
|
- name: Login to GHCR
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push minimal
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.minimal
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.minimal }}
|
||||||
|
|
||||||
|
- name: Build and push busybox
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.busybox
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.busybox }}
|
||||||
|
|
||||||
|
- name: Build and push full
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.full
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.full }}
|
||||||
|
|
||||||
|
- name: Sign images
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
env:
|
||||||
|
TAGS_MINIMAL: ${{ steps.tags.outputs.minimal }}
|
||||||
|
TAGS_BUSYBOX: ${{ steps.tags.outputs.busybox }}
|
||||||
|
TAGS_FULL: ${{ steps.tags.outputs.full }}
|
||||||
|
run: |
|
||||||
|
IFS=',' read -ra TAGS <<< "$TAGS_MINIMAL,$TAGS_BUSYBOX,$TAGS_FULL"
|
||||||
|
for tag in "${TAGS[@]}"; do
|
||||||
|
cosign sign --yes "$tag"
|
||||||
|
done
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
name: Build Docker images (test, no publish)
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build ${{ matrix.file }} (${{ matrix.platform }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
file: [Dockerfile.minimal, Dockerfile.busybox, Dockerfile.full]
|
||||||
|
platform: [linux/amd64, linux/arm64]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ matrix.file }}
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
push: false
|
||||||
|
load: ${{ matrix.platform == 'linux/amd64' }}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
name: Build Docker images (Docker Hub)
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.io
|
||||||
|
IMAGE_NAME: 3proxy/3proxy
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build and push Docker images
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Determine tags
|
||||||
|
id: tags
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: |
|
||||||
|
if [[ "$RELEASE_TAG" != "" ]]; then
|
||||||
|
RELEASE="${RELEASE_TAG#v}"
|
||||||
|
echo "minimal=${REGISTRY}/${IMAGE_NAME}:${RELEASE}.minimal,${REGISTRY}/${IMAGE_NAME}:minimal" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "busybox=${REGISTRY}/${IMAGE_NAME}:${RELEASE}.busybox,${REGISTRY}/${IMAGE_NAME}:busybox" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "full=${REGISTRY}/${IMAGE_NAME}:${RELEASE},${REGISTRY}/${IMAGE_NAME}:latest" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
DATETIME=$(date +%d%m%y%H%M%S)
|
||||||
|
BRANCH=$(echo "${GITHUB_REF#refs/heads/}" | tr "/" "-")
|
||||||
|
echo "minimal=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-${BRANCH}.minimal,${REGISTRY}/${IMAGE_NAME}:${BRANCH}.minimal" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "busybox=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-${BRANCH}.busybox,${REGISTRY}/${IMAGE_NAME}:${BRANCH}.busybox" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "full=${REGISTRY}/${IMAGE_NAME}:${DATETIME}-${BRANCH},${REGISTRY}/${IMAGE_NAME}:${BRANCH}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Install cosign
|
||||||
|
uses: sigstore/cosign-installer@v3
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push minimal
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.minimal
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.minimal }}
|
||||||
|
|
||||||
|
- name: Build and push busybox
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.busybox
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.busybox }}
|
||||||
|
|
||||||
|
- name: Build and push full
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.full
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,ppc64le
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.tags.outputs.full }}
|
||||||
|
|
||||||
|
- name: Sign images
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
env:
|
||||||
|
TAGS_MINIMAL: ${{ steps.tags.outputs.minimal }}
|
||||||
|
TAGS_BUSYBOX: ${{ steps.tags.outputs.busybox }}
|
||||||
|
TAGS_FULL: ${{ steps.tags.outputs.full }}
|
||||||
|
run: |
|
||||||
|
IFS=',' read -ra TAGS <<< "$TAGS_MINIMAL,$TAGS_BUSYBOX,$TAGS_FULL"
|
||||||
|
for tag in "${TAGS[@]}"; do
|
||||||
|
cosign sign --yes "$tag"
|
||||||
|
done
|
||||||
+15
@@ -18,6 +18,7 @@ bin/socks
|
|||||||
bin/tcppm
|
bin/tcppm
|
||||||
bin/udppm
|
bin/udppm
|
||||||
bin/pop3p
|
bin/pop3p
|
||||||
|
bin/imapp
|
||||||
bin/smtpp
|
bin/smtpp
|
||||||
bin/ftppr
|
bin/ftppr
|
||||||
bin/mycrypt
|
bin/mycrypt
|
||||||
@@ -45,6 +46,7 @@ src/socks
|
|||||||
src/tcppm
|
src/tcppm
|
||||||
src/udppm
|
src/udppm
|
||||||
src/pop3p
|
src/pop3p
|
||||||
|
src/imapp
|
||||||
src/smtpp
|
src/smtpp
|
||||||
src/ftppr
|
src/ftppr
|
||||||
src/icqpr
|
src/icqpr
|
||||||
@@ -258,3 +260,16 @@ pip-log.txt
|
|||||||
#Mr Developer
|
#Mr Developer
|
||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
|
bin/3proxy_crypt
|
||||||
|
bin/3proxy_ftppr
|
||||||
|
bin/3proxy_pop3p
|
||||||
|
bin/3proxy_imapp
|
||||||
|
bin/3proxy_proxy
|
||||||
|
bin/3proxy_smtpp
|
||||||
|
bin/3proxy_socks
|
||||||
|
bin/3proxy_tcppm
|
||||||
|
bin/3proxy_tlspr
|
||||||
|
bin/3proxy_udppm
|
||||||
|
build*/*
|
||||||
|
testcerts/
|
||||||
|
/.claude
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
3proxy-0.9.9 Released August, 20 2026
|
||||||
|
|
||||||
|
! Fix: DNS replies are validated now: a reply from an address other than the nameserver the query was sent to, and a reply with a question section not matching the query, are dropped; both were accepted before
|
||||||
|
! Fix: socket leak with SOCKSv5 UDP ASSOCIATE through a parent proxy, sockets were accumulated in CLOSE_WAIT state until descriptors ran out
|
||||||
|
! Fix: file descriptor leak in HTTP proxy on the ftp:// request path
|
||||||
|
! Fix: crash with illegal instruction on some platforms (e.g. some musl based Linux builds), caused by a memcpy on overlapping buffers
|
||||||
|
! Fix: extip and ha (HAProxy PROXY protocol) parents are applied to SOCKSv5 UDP ASSOCIATE now
|
||||||
|
! Fix: only socks5 and socks5+ parents are tried for UDP ASSOCIATE, other parent types can not be used for UDP
|
||||||
|
! Fix: udppm through a SOCKSv5 parent did not work
|
||||||
|
! Fix: -Ne and -Ni options were never applied, the option letter was not parsed; -Ne is not applied to the UDP ASSOCIATE reply anymore, -Ni is applied to it
|
||||||
|
! Fix: -4 / -6 handling for UDP in socks; a single UDP association can use both IPv4 and IPv6 destinations now
|
||||||
|
! Fix: a datagram with a null destination address is dropped now
|
||||||
|
! Fix: DNS over TCP: a reply which did not fit a single read was never processed
|
||||||
|
! Documentation: "How to apply ACLs to UDP traffic" added to HOWTO; authentication cache, ACL and UDP notes added to "Optimizing 3proxy for High Load" and to security recommendations
|
||||||
|
+ SOCKSv5 UDP: the destination of every datagram is authorized, so ACLs limiting the destination address, host name or port apply to UDP traffic now; the parent proxy and the external address are selected for the destination of the datagram and not for the UDP ASSOCIATE request
|
||||||
|
+ socks: -U option to control what happens when the destination changes within an UDP association: log it, authorize it, both (default) or neither
|
||||||
|
+ -C option (for TCP services) to terminate the session as soon as any of the sides closes the connection; by default the session is kept until both sides close it (TCP half-close)
|
||||||
|
+ timeouts: LINGER value added (11th, default 5), used to deliver buffered data after one of the sides has closed its sending side and as SO_LINGER value on outgoing connections
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
3proxy-0.9.9 Вышел 20 Августа 2026
|
||||||
|
|
||||||
|
! Исправление: ответы DNS теперь проверяются: ответ с адреса, отличного от адреса сервера имён, которому был отправлен запрос, а также ответ с секцией вопроса, не совпадающей с запросом, отбрасываются; ранее оба принимались
|
||||||
|
! Исправление: утечка сокетов при SOCKSv5 UDP ASSOCIATE через вышестоящий прокси, сокеты накапливались в состоянии CLOSE_WAIT до исчерпания дескрипторов
|
||||||
|
! Исправление: утечка файловых дескрипторов в HTTP-прокси на пути обработки запроса ftp://
|
||||||
|
! Исправление: аварийное завершение с недопустимой инструкцией на некоторых платформах (например, в некоторых сборках Linux на основе musl) из-за memcpy на перекрывающихся буферах
|
||||||
|
! Исправление: родители типа extip и ha (HAProxy PROXY protocol) теперь применяются к SOCKSv5 UDP ASSOCIATE
|
||||||
|
! Исправление: для UDP ASSOCIATE используются только родители socks5 и socks5+, остальные типы для UDP неприменимы
|
||||||
|
! Исправление: udppm через вышестоящий прокси SOCKSv5 не работал
|
||||||
|
! Исправление: опции -Ne и -Ni никогда не применялись, буква опции не разбиралась; -Ne больше не применяется к ответу на UDP ASSOCIATE, -Ni применяется к нему
|
||||||
|
! Исправление: обработка -4 / -6 для UDP в socks; одна UDP-ассоциация теперь может использовать адреса назначения и IPv4, и IPv6
|
||||||
|
! Исправление: датаграмма с нулевым адресом назначения теперь отбрасывается
|
||||||
|
! Исправление: DNS поверх TCP: ответ, не помещавшийся в одно чтение, никогда не обрабатывался
|
||||||
|
! Документация: в HOWTO добавлен раздел "Как применять ACL к UDP-трафику"; в "Optimizing 3proxy for High Load" и в рекомендации по безопасности добавлены заметки о кэше аутентификации, ACL и UDP
|
||||||
|
+ SOCKSv5 UDP: адрес назначения каждой датаграммы авторизуется, поэтому ACL, ограничивающие адрес назначения, имя хоста или порт, теперь применяются к UDP-трафику; вышестоящий прокси и внешний адрес выбираются для адреса назначения датаграммы, а не для запроса UDP ASSOCIATE
|
||||||
|
+ socks: опция -U для управления тем, что происходит при смене адреса назначения в рамках UDP-ассоциации: журналировать, авторизовать, и то и другое (по умолчанию) или ничего
|
||||||
|
+ Опция -C (для TCP-сервисов) завершает сессию, как только любая из сторон закрывает соединение; по умолчанию сессия сохраняется, пока соединение не закроют обе стороны (полузакрытие TCP)
|
||||||
|
+ timeouts: добавлено значение LINGER (11-е, по умолчанию 5), используется для доставки буферизованных данных после того, как одна из сторон закрыла свою передающую сторону, а также как значение SO_LINGER для исходящих соединений
|
||||||
+384
-87
@@ -46,14 +46,42 @@ endif()
|
|||||||
|
|
||||||
# Options
|
# Options
|
||||||
option(3PROXY_BUILD_SHARED "Build shared libraries for plugins" ON)
|
option(3PROXY_BUILD_SHARED "Build shared libraries for plugins" ON)
|
||||||
option(3PROXY_USE_OPENSSL "Enable OpenSSL/SSLPlugin" ON)
|
option(3PROXY_USE_WOLFSSL "Enable TLS/SSL support via wolfSSL (preferred when detected)" ON)
|
||||||
option(3PROXY_USE_PCRE2 "Enable PCRE2/PCREPlugin" ON)
|
option(3PROXY_USE_OPENSSL "Enable TLS/SSL support via OpenSSL (fallback when wolfSSL unavailable)" 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 "Use Linux splice() for zero-copy (Linux only)" ON)
|
option(3PROXY_USE_SPLICE "Build Linux splice() support, slower than read/write for most traffic (Linux only)" OFF)
|
||||||
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)
|
||||||
|
option(3PROXY_USE_UNIX_SOCKETS "Enable Unix domain socket support (Unix only)" ON)
|
||||||
|
|
||||||
|
if(NOT WIN32 AND NOT APPLE)
|
||||||
|
option(3PROXY_STATIC_LINK "Statically link libraries using -Wl,-Bstatic (Linux/Unix only)" OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Binary name prefix for standalone modules and crypt (default: 3proxy_)
|
||||||
|
# For crypt: if prefix is empty, "my" is used instead (→ mycrypt)
|
||||||
|
set(3PROXY_BINARY_PREFIX "3proxy_" CACHE STRING "Prefix for standalone module and crypt binary names")
|
||||||
|
|
||||||
|
# Standalone module build options (ON by default)
|
||||||
|
option(3PROXY_BUILD_NONE "Do not build standalone binaries" OFF)
|
||||||
|
option(3PROXY_BUILD_PROXY "Build standalone proxy binary" ON)
|
||||||
|
option(3PROXY_BUILD_SOCKS "Build standalone socks binary" ON)
|
||||||
|
option(3PROXY_BUILD_POP3P "Build standalone pop3p binary" ON)
|
||||||
|
option(3PROXY_BUILD_IMAPP "Build standalone imapp binary" ON)
|
||||||
|
option(3PROXY_BUILD_SMTPP "Build standalone smtpp binary" ON)
|
||||||
|
option(3PROXY_BUILD_FTPPR "Build standalone ftppr binary" ON)
|
||||||
|
option(3PROXY_BUILD_TCPPM "Build standalone tcppm binary" ON)
|
||||||
|
option(3PROXY_BUILD_UDPPM "Build standalone udppm binary" ON)
|
||||||
|
option(3PROXY_BUILD_TLSPR "Build standalone tlspr binary" ON)
|
||||||
|
|
||||||
|
if(3PROXY_BUILD_NONE)
|
||||||
|
foreach(_M PROXY SOCKS POP3P IMAPP SMTPP FTPPR TCPPM UDPPM TLSPR)
|
||||||
|
set(3PROXY_BUILD_${_M} OFF)
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Output directory
|
# Output directory
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
@@ -83,7 +111,6 @@ if(WIN32)
|
|||||||
# MSVC-specific settings
|
# MSVC-specific settings
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
MSVC
|
MSVC
|
||||||
WITH_SSL
|
|
||||||
)
|
)
|
||||||
# Use static runtime library
|
# Use static runtime library
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
@@ -101,7 +128,6 @@ if(WIN32)
|
|||||||
# clang-cl (Clang with MSVC frontend)
|
# clang-cl (Clang with MSVC frontend)
|
||||||
add_compile_definitions(
|
add_compile_definitions(
|
||||||
MSVC
|
MSVC
|
||||||
WITH_SSL
|
|
||||||
)
|
)
|
||||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
@@ -159,10 +185,15 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
add_compile_definitions(WITH_NETFILTER)
|
add_compile_definitions(WITH_NETFILTER)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(3PROXY_USE_UNIX_SOCKETS)
|
||||||
|
add_compile_definitions(WITH_UN)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(DEFAULT_PLUGINS
|
set(DEFAULT_PLUGINS
|
||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
|
FilePlugin
|
||||||
)
|
)
|
||||||
|
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
||||||
@@ -176,10 +207,15 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD|Darwin|OpenBSD|NetBSD")
|
|||||||
add_compile_options(-fno-strict-aliasing)
|
add_compile_options(-fno-strict-aliasing)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(3PROXY_USE_UNIX_SOCKETS)
|
||||||
|
add_compile_definitions(WITH_UN)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(DEFAULT_PLUGINS
|
set(DEFAULT_PLUGINS
|
||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
|
FilePlugin
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
@@ -188,13 +224,24 @@ else()
|
|||||||
add_compile_options(-fno-strict-aliasing)
|
add_compile_options(-fno-strict-aliasing)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(3PROXY_USE_UNIX_SOCKETS)
|
||||||
|
add_compile_definitions(WITH_UN)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(DEFAULT_PLUGINS
|
set(DEFAULT_PLUGINS
|
||||||
StringsPlugin
|
StringsPlugin
|
||||||
TrafficPlugin
|
TrafficPlugin
|
||||||
TransparentPlugin
|
TransparentPlugin
|
||||||
|
FilePlugin
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Unix domain sockets off: NO_UN also undefines WITH_UN if it arrives from
|
||||||
|
# elsewhere, e.g. CFLAGS
|
||||||
|
if(NOT 3PROXY_USE_UNIX_SOCKETS)
|
||||||
|
add_compile_definitions(NO_UN)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Common definitions
|
# Common definitions
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Windows: use WSAPOLL
|
# Windows: use WSAPOLL
|
||||||
@@ -214,17 +261,38 @@ endif()
|
|||||||
|
|
||||||
# Find dependencies
|
# Find dependencies
|
||||||
|
|
||||||
# OpenSSL
|
# TLS/SSL backend: prefer wolfSSL when detected, fall back to OpenSSL.
|
||||||
|
set(3PROXY_SSL_ENABLED FALSE)
|
||||||
|
set(3PROXY_SSL_WOLFSSL FALSE)
|
||||||
set(OPENSSL_FOUND FALSE)
|
set(OPENSSL_FOUND FALSE)
|
||||||
if(3PROXY_USE_OPENSSL)
|
set(WOLFSSL_FOUND FALSE)
|
||||||
find_package(OpenSSL QUIET)
|
|
||||||
|
if(3PROXY_USE_WOLFSSL)
|
||||||
|
find_path(WOLFSSL_INCLUDE_DIR NAMES wolfssl/options.h wolfssl/ssl.h)
|
||||||
|
find_library(WOLFSSL_LIBRARIES NAMES wolfssl)
|
||||||
|
if(WOLFSSL_INCLUDE_DIR AND WOLFSSL_LIBRARIES)
|
||||||
|
set(WOLFSSL_FOUND TRUE)
|
||||||
|
set(3PROXY_SSL_ENABLED TRUE)
|
||||||
|
set(3PROXY_SSL_WOLFSSL TRUE)
|
||||||
|
add_compile_definitions(WITH_SSL WITH_WOLFSSL)
|
||||||
|
message(STATUS "wolfSSL found: ${WOLFSSL_LIBRARIES} (preferred backend)")
|
||||||
|
else()
|
||||||
|
message(STATUS "wolfSSL not found, falling back to OpenSSL if enabled")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT 3PROXY_SSL_ENABLED AND 3PROXY_USE_OPENSSL)
|
||||||
|
find_package(OpenSSL REQUIRED)
|
||||||
if(OpenSSL_FOUND)
|
if(OpenSSL_FOUND)
|
||||||
set(OPENSSL_FOUND TRUE)
|
set(OPENSSL_FOUND TRUE)
|
||||||
|
set(3PROXY_SSL_ENABLED TRUE)
|
||||||
add_compile_definitions(WITH_SSL)
|
add_compile_definitions(WITH_SSL)
|
||||||
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
|
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
|
||||||
else()
|
|
||||||
message(STATUS "OpenSSL not found, SSLPlugin will not be built")
|
|
||||||
endif()
|
endif()
|
||||||
|
elseif(NOT 3PROXY_SSL_ENABLED)
|
||||||
|
message(STATUS "SSL disabled (neither wolfSSL nor OpenSSL enabled/found)")
|
||||||
|
elseif(3PROXY_SSL_WOLFSSL)
|
||||||
|
message(STATUS "OpenSSL skipped (wolfSSL in use)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# PCRE2
|
# PCRE2
|
||||||
@@ -232,9 +300,10 @@ set(PCRE2_FOUND FALSE)
|
|||||||
if(3PROXY_USE_PCRE2)
|
if(3PROXY_USE_PCRE2)
|
||||||
find_package(PCRE2 QUIET)
|
find_package(PCRE2 QUIET)
|
||||||
if(PCRE2_FOUND)
|
if(PCRE2_FOUND)
|
||||||
|
add_compile_definitions(WITH_PCRE)
|
||||||
message(STATUS "PCRE2 found: ${PCRE2_VERSION}")
|
message(STATUS "PCRE2 found: ${PCRE2_VERSION}")
|
||||||
else()
|
else()
|
||||||
message(STATUS "PCRE2 not found, PCREPlugin will not be built")
|
message(STATUS "PCRE2 not found, PCRE support will not be built")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -260,27 +329,37 @@ if(WIN32 OR 3PROXY_USE_ODBC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set NOODBC if ODBC is not found
|
# Define WITH_ODBC when ODBC is available
|
||||||
if(NOT ODBC_FOUND)
|
if(ODBC_FOUND)
|
||||||
add_compile_definitions(NOODBC)
|
add_compile_definitions(WITH_ODBC)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set NORADIUS if no SSL backend is available (RADIUS MD5 uses bundled md5, but
|
||||||
|
# keep the historical gate tied to SSL availability).
|
||||||
|
if(NOT 3PROXY_SSL_ENABLED)
|
||||||
|
add_compile_definitions(NORADIUS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Source files for 3proxy core
|
# Source files for 3proxy core
|
||||||
set(3PROXY_CORE_SOURCES
|
set(3PROXY_CORE_SOURCES
|
||||||
src/3proxy.c
|
src/3proxy.c
|
||||||
src/auth.c
|
src/auth.c
|
||||||
|
src/acl.c
|
||||||
|
src/limiter.c
|
||||||
|
src/redirect.c
|
||||||
src/authradius.c
|
src/authradius.c
|
||||||
|
src/hash.c
|
||||||
|
src/hashtables.c
|
||||||
|
src/resolve.c
|
||||||
|
src/sql.c
|
||||||
src/conf.c
|
src/conf.c
|
||||||
src/datatypes.c
|
src/datatypes.c
|
||||||
src/plugins.c
|
src/plugins.c
|
||||||
src/stringtable.c
|
src/stringtable.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# MD4/MD5 sources for mycrypt
|
# Bundled hash implementations (md4.c, md5.c, blake2b-ref.c) self-disable
|
||||||
set(MD_SOURCES
|
# via preprocessor guards when wolfSSL provides them natively.
|
||||||
src/libs/md4.c
|
|
||||||
src/libs/md5.c
|
|
||||||
)
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Object libraries for common sources (shared between executables)
|
# Object libraries for common sources (shared between executables)
|
||||||
@@ -299,15 +378,24 @@ target_include_directories(common_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|||||||
add_library(base64_obj OBJECT src/base64.c)
|
add_library(base64_obj OBJECT src/base64.c)
|
||||||
target_include_directories(base64_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(base64_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
|
# mdhash object library. md4.c/md5.c self-disable via NO_MD4/NO_MD5 guards
|
||||||
|
# when wolfSSL provides them; always compiled for fallback.
|
||||||
|
add_library(mdhash_obj OBJECT src/mdhash.c src/libs/md4.c src/libs/md5.c src/libs/blake2b-ref.c)
|
||||||
|
target_include_directories(mdhash_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
target_include_directories(mdhash_obj PRIVATE ${WOLFSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Object libraries for 3proxy (compiled WITHOUT WITHMAIN)
|
# Object libraries for 3proxy (compiled WITHOUT WITHMAIN)
|
||||||
# These are used by the main 3proxy executable
|
# These are used by the main 3proxy executable
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
# Server modules object library (without WITHMAIN)
|
# Server modules object library (without WITHMAIN, without UDP)
|
||||||
add_library(srv_modules OBJECT
|
add_library(srv_modules OBJECT
|
||||||
src/proxy.c
|
src/proxy.c
|
||||||
src/pop3p.c
|
src/pop3p.c
|
||||||
|
src/imapp.c
|
||||||
src/smtpp.c
|
src/smtpp.c
|
||||||
src/ftppr.c
|
src/ftppr.c
|
||||||
src/tcppm.c
|
src/tcppm.c
|
||||||
@@ -315,13 +403,21 @@ add_library(srv_modules OBJECT
|
|||||||
src/auto.c
|
src/auto.c
|
||||||
src/socks.c
|
src/socks.c
|
||||||
src/webadmin.c
|
src/webadmin.c
|
||||||
src/udppm.c
|
|
||||||
src/dnspr.c
|
src/dnspr.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(srv_modules PRIVATE
|
target_include_directories(srv_modules PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
# UDP port mapper server module (without WITHMAIN)
|
||||||
|
add_library(srvudppm_obj OBJECT src/udppm.c)
|
||||||
|
target_include_directories(srvudppm_obj PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# UDP socket relay (used by 3proxy, socks, udppm)
|
||||||
|
add_library(udpsockmap_obj OBJECT src/udpsockmap.c)
|
||||||
|
target_include_directories(udpsockmap_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
# mainfunc object (proxymain.c compiled with MODULEMAINFUNC=mainfunc for 3proxy)
|
# mainfunc object (proxymain.c compiled with MODULEMAINFUNC=mainfunc for 3proxy)
|
||||||
add_library(mainfunc OBJECT src/proxymain.c)
|
add_library(mainfunc OBJECT src/proxymain.c)
|
||||||
@@ -332,9 +428,16 @@ target_compile_definitions(mainfunc PRIVATE MODULEMAINFUNC=mainfunc)
|
|||||||
add_library(ftp_obj OBJECT src/ftp.c)
|
add_library(ftp_obj OBJECT src/ftp.c)
|
||||||
target_include_directories(ftp_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(ftp_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
# mycrypt object for 3proxy (without WITHMAIN)
|
# 3proxy_crypt object for 3proxy (without WITHMAIN)
|
||||||
add_library(mycrypt_obj OBJECT src/mycrypt.c)
|
add_library(3proxy_crypt_obj OBJECT src/3proxy_crypt.c)
|
||||||
target_include_directories(mycrypt_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
target_include_directories(3proxy_crypt_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
if(3PROXY_SSL_ENABLED)
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
target_include_directories(3proxy_crypt_obj PRIVATE ${WOLFSSL_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
target_include_directories(3proxy_crypt_obj PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Main 3proxy executable
|
# Main 3proxy executable
|
||||||
@@ -343,19 +446,39 @@ target_include_directories(mycrypt_obj PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|||||||
|
|
||||||
add_executable(3proxy
|
add_executable(3proxy
|
||||||
${3PROXY_CORE_SOURCES}
|
${3PROXY_CORE_SOURCES}
|
||||||
${MD_SOURCES}
|
|
||||||
$<TARGET_OBJECTS:srv_modules>
|
$<TARGET_OBJECTS:srv_modules>
|
||||||
|
$<TARGET_OBJECTS:srvudppm_obj>
|
||||||
$<TARGET_OBJECTS:mainfunc>
|
$<TARGET_OBJECTS:mainfunc>
|
||||||
$<TARGET_OBJECTS:common_obj>
|
$<TARGET_OBJECTS:common_obj>
|
||||||
|
$<TARGET_OBJECTS:udpsockmap_obj>
|
||||||
$<TARGET_OBJECTS:base64_obj>
|
$<TARGET_OBJECTS:base64_obj>
|
||||||
|
$<TARGET_OBJECTS:mdhash_obj>
|
||||||
$<TARGET_OBJECTS:ftp_obj>
|
$<TARGET_OBJECTS:ftp_obj>
|
||||||
$<TARGET_OBJECTS:mycrypt_obj>
|
$<TARGET_OBJECTS:3proxy_crypt_obj>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(3PROXY_SSL_ENABLED)
|
||||||
|
target_sources(3proxy PRIVATE src/ssllib.c src/ssl.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
target_sources(3proxy PRIVATE src/pcre.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(3proxy PRIVATE
|
target_include_directories(3proxy PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
||||||
)
|
)
|
||||||
|
if(3PROXY_SSL_ENABLED)
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
target_include_directories(3proxy PRIVATE ${WOLFSSL_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
target_include_directories(3proxy PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
target_include_directories(3proxy PRIVATE ${PCRE2_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(3proxy PRIVATE Threads::Threads)
|
target_link_libraries(3proxy PRIVATE Threads::Threads)
|
||||||
|
|
||||||
@@ -367,36 +490,158 @@ if(ODBC_FOUND)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
# SSL linking
|
||||||
target_link_libraries(3proxy PRIVATE ${WINDOWS_LIBS})
|
if(3PROXY_SSL_ENABLED)
|
||||||
if(OpenSSL_FOUND)
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
if(3PROXY_STATIC_LINK)
|
||||||
|
# Will be linked statically below (if static library is found)
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy PRIVATE ${WOLFSSL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
elseif(3PROXY_STATIC_LINK)
|
||||||
|
# OpenSSL static linking handled below
|
||||||
|
else()
|
||||||
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# PCRE2 linking
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
if(3PROXY_STATIC_LINK)
|
||||||
|
# Will be linked statically below (if static libraries are found)
|
||||||
|
elseif(TARGET PCRE2::PCRE2)
|
||||||
|
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy PRIVATE ${PCRE2_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Static linking of SSL backend and PCRE2 (when option is enabled)
|
||||||
|
if(3PROXY_STATIC_LINK AND ((3PROXY_SSL_ENABLED AND NOT 3PROXY_SSL_WOLFSSL) OR (3PROXY_SSL_WOLFSSL) OR PCRE2_FOUND))
|
||||||
|
set(_saved_cmake_find_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
|
|
||||||
|
set(_static_libs "")
|
||||||
|
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
find_library(_wolfssl_static_lib NAMES wolfssl)
|
||||||
|
if(_wolfssl_static_lib)
|
||||||
|
list(APPEND _static_libs ${_wolfssl_static_lib})
|
||||||
|
endif()
|
||||||
|
elseif(OpenSSL_FOUND)
|
||||||
|
find_library(_ssl_static_lib ssl)
|
||||||
|
find_library(_crypto_static_lib crypto)
|
||||||
|
if(_ssl_static_lib AND _crypto_static_lib)
|
||||||
|
list(APPEND _static_libs ${_ssl_static_lib} ${_crypto_static_lib})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
find_library(_pcre2_static_lib NAMES pcre2-8)
|
||||||
|
if(_pcre2_static_lib)
|
||||||
|
list(APPEND _static_libs ${_pcre2_static_lib})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_saved_cmake_find_library_suffixes})
|
||||||
|
|
||||||
|
if(_static_libs)
|
||||||
|
target_link_libraries(3proxy PRIVATE -Wl,-Bstatic ${_static_libs} -Wl,-Bdynamic)
|
||||||
|
message(STATUS "Static linking enabled for SSL backend/PCRE2")
|
||||||
|
else()
|
||||||
|
message(WARNING "3PROXY_STATIC_LINK is ON but static libraries not found, falling back to dynamic")
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
target_link_libraries(3proxy PRIVATE ${WOLFSSL_LIBRARIES})
|
||||||
|
elseif(OpenSSL_FOUND)
|
||||||
|
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
if(PCRE2_FOUND)
|
||||||
|
if(TARGET PCRE2::PCRE2)
|
||||||
|
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy PRIVATE ${PCRE2_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(3proxy PRIVATE ${WINDOWS_LIBS})
|
||||||
if(COMPILER_IS_MSVC AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3proxy.rc)
|
if(COMPILER_IS_MSVC AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3proxy.rc)
|
||||||
target_sources(3proxy PRIVATE 3proxy.rc)
|
target_sources(3proxy PRIVATE 3proxy.rc)
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
target_link_libraries(3proxy PRIVATE dl)
|
target_link_libraries(3proxy PRIVATE dl)
|
||||||
if(OpenSSL_FOUND)
|
|
||||||
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build mycrypt utility
|
# Build 3proxy_crypt utility
|
||||||
add_executable(mycrypt
|
add_executable(3proxy_crypt
|
||||||
src/mycrypt.c
|
src/3proxy_crypt.c
|
||||||
${MD_SOURCES}
|
|
||||||
$<TARGET_OBJECTS:base64_obj>
|
$<TARGET_OBJECTS:base64_obj>
|
||||||
|
$<TARGET_OBJECTS:mdhash_obj>
|
||||||
)
|
)
|
||||||
target_compile_definitions(mycrypt PRIVATE WITHMAIN)
|
target_compile_definitions(3proxy_crypt PRIVATE WITHMAIN)
|
||||||
target_include_directories(mycrypt PRIVATE
|
target_include_directories(3proxy_crypt PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
${CMAKE_CURRENT_SOURCE_DIR}/src/libs
|
||||||
)
|
)
|
||||||
target_link_libraries(mycrypt PRIVATE Threads::Threads)
|
if(3PROXY_SSL_ENABLED)
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
target_include_directories(3proxy_crypt PRIVATE ${WOLFSSL_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
target_include_directories(3proxy_crypt PRIVATE ${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE Threads::Threads)
|
||||||
|
if(3PROXY_SSL_ENABLED)
|
||||||
|
if(3PROXY_SSL_WOLFSSL)
|
||||||
|
if(3PROXY_STATIC_LINK)
|
||||||
|
set(_saved_cmake_find_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
|
find_library(_wolfssl_static_lib_c NAMES wolfssl)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_saved_cmake_find_library_suffixes})
|
||||||
|
if(_wolfssl_static_lib_c)
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE -Wl,-Bstatic ${_wolfssl_static_lib_c} -Wl,-Bdynamic)
|
||||||
|
message(STATUS "3proxy_crypt: static wolfSSL")
|
||||||
|
else()
|
||||||
|
message(WARNING "3PROXY_STATIC_LINK is ON but static wolfSSL not found, using dynamic")
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE ${WOLFSSL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE ${WOLFSSL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(3PROXY_STATIC_LINK)
|
||||||
|
set(_saved_cmake_find_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
|
find_library(_ssl_static_lib ssl)
|
||||||
|
find_library(_crypto_static_lib crypto)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_saved_cmake_find_library_suffixes})
|
||||||
|
if(_ssl_static_lib AND _crypto_static_lib)
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE -Wl,-Bstatic ${_ssl_static_lib} ${_crypto_static_lib} -Wl,-Bdynamic)
|
||||||
|
message(STATUS "3proxy_crypt: static OpenSSL")
|
||||||
|
else()
|
||||||
|
message(WARNING "3PROXY_STATIC_LINK is ON but static OpenSSL not found, using dynamic")
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
target_link_libraries(3proxy_crypt PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if("${3PROXY_BINARY_PREFIX}" STREQUAL "")
|
||||||
|
set_target_properties(3proxy_crypt PROPERTIES OUTPUT_NAME "mycrypt")
|
||||||
|
else()
|
||||||
|
set_target_properties(3proxy_crypt PROPERTIES OUTPUT_NAME "${3PROXY_BINARY_PREFIX}crypt")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Build standalone proxy executables
|
# Build standalone proxy executables
|
||||||
foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
foreach(PROXY_NAME proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
||||||
|
string(TOUPPER "${PROXY_NAME}" _MODULE_OPT)
|
||||||
|
if(NOT 3PROXY_BUILD_${_MODULE_OPT})
|
||||||
|
continue()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(PROXY_NAME STREQUAL "ftppr" OR PROXY_NAME STREQUAL "proxy")
|
if(PROXY_NAME STREQUAL "ftppr" OR PROXY_NAME STREQUAL "proxy")
|
||||||
# ftppr and proxy use ftp_obj
|
# ftppr and proxy use ftp_obj
|
||||||
add_executable(${PROXY_NAME}
|
add_executable(${PROXY_NAME}
|
||||||
@@ -411,6 +656,10 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set_target_properties(${PROXY_NAME} PROPERTIES
|
||||||
|
OUTPUT_NAME "${3PROXY_BINARY_PREFIX}${PROXY_NAME}"
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(${PROXY_NAME} PRIVATE
|
target_include_directories(${PROXY_NAME} PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
@@ -420,6 +669,10 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
|||||||
NOPORTMAP
|
NOPORTMAP
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(NOT PROXY_NAME STREQUAL "udppm")
|
||||||
|
target_compile_definitions(${PROXY_NAME} PRIVATE NOUDPMAIN)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(${PROXY_NAME} PRIVATE Threads::Threads)
|
target_link_libraries(${PROXY_NAME} PRIVATE Threads::Threads)
|
||||||
|
|
||||||
if(PROXY_NAME STREQUAL "proxy")
|
if(PROXY_NAME STREQUAL "proxy")
|
||||||
@@ -434,9 +687,17 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
|||||||
target_link_libraries(${PROXY_NAME} PRIVATE ${WINDOWS_LIBS})
|
target_link_libraries(${PROXY_NAME} PRIVATE ${WINDOWS_LIBS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PROXY_NAME STREQUAL "proxy" OR PROXY_NAME STREQUAL "smtpp")
|
if(PROXY_NAME STREQUAL "proxy" OR PROXY_NAME STREQUAL "smtpp" OR PROXY_NAME STREQUAL "imapp")
|
||||||
target_sources(${PROXY_NAME} PRIVATE $<TARGET_OBJECTS:base64_obj>)
|
target_sources(${PROXY_NAME} PRIVATE $<TARGET_OBJECTS:base64_obj>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PROXY_NAME STREQUAL "udppm")
|
||||||
|
target_sources(${PROXY_NAME} PRIVATE src/hash.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(PROXY_NAME STREQUAL "socks" OR PROXY_NAME STREQUAL "udppm")
|
||||||
|
target_sources(${PROXY_NAME} PRIVATE src/udpsockmap.c)
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Plugin output directory
|
# Plugin output directory
|
||||||
@@ -455,53 +716,67 @@ foreach(PLUGIN ${DEFAULT_PLUGINS})
|
|||||||
add_subdirectory(src/plugins/${PLUGIN})
|
add_subdirectory(src/plugins/${PLUGIN})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(OPENSSL_FOUND)
|
|
||||||
add_subdirectory(src/plugins/SSLPlugin)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PCRE2_FOUND)
|
|
||||||
add_subdirectory(src/plugins/PCREPlugin)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PAM_FOUND)
|
if(PAM_FOUND)
|
||||||
add_subdirectory(src/plugins/PamAuth)
|
add_subdirectory(src/plugins/PamAuth)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build full list of plugins to be built
|
# Build full list of plugins to be built
|
||||||
set(ALL_PLUGINS ${DEFAULT_PLUGINS})
|
set(ALL_PLUGINS ${DEFAULT_PLUGINS})
|
||||||
if(OPENSSL_FOUND)
|
|
||||||
list(APPEND ALL_PLUGINS SSLPlugin)
|
|
||||||
endif()
|
|
||||||
if(PCRE2_FOUND)
|
|
||||||
list(APPEND ALL_PLUGINS PCREPlugin)
|
|
||||||
endif()
|
|
||||||
if(PAM_FOUND)
|
if(PAM_FOUND)
|
||||||
list(APPEND ALL_PLUGINS PamAuth)
|
list(APPEND ALL_PLUGINS PamAuth)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Installation rules
|
# Installation rules
|
||||||
install(TARGETS 3proxy mycrypt proxy socks pop3p smtpp ftppr tcppm udppm tlspr
|
install(TARGETS 3proxy 3proxy_crypt
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
foreach(PROXY_NAME proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
||||||
|
string(TOUPPER "${PROXY_NAME}" _MODULE_OPT)
|
||||||
|
if(3PROXY_BUILD_${_MODULE_OPT})
|
||||||
|
install(TARGETS ${PROXY_NAME}
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Install plugins
|
# Install plugins
|
||||||
file(GLOB PLUGINFILES "${PLUGIN_OUTPUT_DIR}/*${PLUGIN_SUFFIX}")
|
# Use install(DIRECTORY ... FILES_MATCHING) so the glob resolves at install
|
||||||
|
# time, after plugin targets have been built. A configure-time file(GLOB)
|
||||||
|
# would run before any plugin exists and install nothing.
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install(FILES
|
install(DIRECTORY ${PLUGIN_OUTPUT_DIR}/
|
||||||
${PLUGINFILES}
|
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
FILES_MATCHING PATTERN "*${PLUGIN_SUFFIX}"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
install(FILES
|
install(DIRECTORY ${PLUGIN_OUTPUT_DIR}/
|
||||||
${PLUGINFILES}
|
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
||||||
|
FILES_MATCHING PATTERN "*${PLUGIN_SUFFIX}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Install configuration files
|
# Install configuration files
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
install(FILES scripts/3proxy.cfg DESTINATION /etc/3proxy)
|
set(CRYPT_PREFIX "${3PROXY_BINARY_PREFIX}")
|
||||||
install(FILES scripts/add3proxyuser.sh DESTINATION ${CMAKE_INSTALL_BINDIR})
|
set(3PROXY_CONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/3proxy/conf")
|
||||||
|
set(3PROXY_COUNTERDIR "/opt/3proxy")
|
||||||
|
install(DIRECTORY DESTINATION /opt/3proxy)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/scripts/3proxy.cfg.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/3proxy.cfg
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/3proxy.cfg DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/3proxy)
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/scripts/add3proxyuser.sh.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/add3proxyuser
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/add3proxyuser
|
||||||
|
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Install service files (systemd, launchd, init.d, or rc.d)
|
# Install service files (systemd, launchd, init.d, or rc.d)
|
||||||
@@ -560,16 +835,6 @@ if(NOT WIN32)
|
|||||||
DESTINATION ${SYSTEMD_UNIT_DIR}
|
DESTINATION ${SYSTEMD_UNIT_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Install tmpfiles.d configuration for runtime directory
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts/3proxy.tmpfiles.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/3proxy.conf
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/3proxy.conf
|
|
||||||
DESTINATION /usr/lib/tmpfiles.d
|
|
||||||
)
|
|
||||||
|
|
||||||
message(STATUS " systemd: YES (${SYSTEMD_UNIT_DIR})")
|
message(STATUS " systemd: YES (${SYSTEMD_UNIT_DIR})")
|
||||||
else()
|
else()
|
||||||
# No systemd - install init.d script
|
# No systemd - install init.d script
|
||||||
@@ -602,25 +867,45 @@ if(NOT WIN32)
|
|||||||
message(STATUS " init.d: YES (/etc/init.d)")
|
message(STATUS " init.d: YES (/etc/init.d)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create proxy user and group during installation
|
# Run postinstall only for direct installs (no DESTDIR)
|
||||||
install(FILES scripts/postinstall.sh
|
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
||||||
)
|
|
||||||
install(CODE "
|
install(CODE "
|
||||||
execute_process(
|
if(\"\$ENV{DESTDIR}\" STREQUAL \"\")
|
||||||
COMMAND ${CMAKE_INSTALL_FULL_BINDIR}/postinstall.sh
|
execute_process(
|
||||||
RESULT_VARIABLE POSTINSTALL_RESULT
|
COMMAND ${CMAKE_COMMAND} -E env sh ${CMAKE_CURRENT_SOURCE_DIR}/scripts/postinstall.sh ${CMAKE_INSTALL_PREFIX}
|
||||||
)
|
RESULT_VARIABLE POSTINSTALL_RESULT
|
||||||
|
)
|
||||||
|
endif()
|
||||||
")
|
")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Install man pages
|
# Install man pages
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
file(GLOB MAN3_FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/*.3")
|
# Config man page (section 5) — no prefix
|
||||||
file(GLOB MAN8_FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/*.8")
|
file(GLOB MAN5_FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/*.5")
|
||||||
install(FILES ${MAN3_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
|
install(FILES ${MAN5_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man5)
|
||||||
install(FILES ${MAN8_FILES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
|
# Main 3proxy man page — no prefix
|
||||||
|
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy.8"
|
||||||
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
|
||||||
|
)
|
||||||
|
# 3proxy_crypt man page — no prefix (already has 3proxy_)
|
||||||
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy_crypt.8")
|
||||||
|
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/man/3proxy_crypt.8"
|
||||||
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
# Module man pages — installed with binary prefix only if module is built
|
||||||
|
foreach(_MAN proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
||||||
|
string(TOUPPER "${_MAN}" _MODULE_OPT)
|
||||||
|
if(3PROXY_BUILD_${_MODULE_OPT})
|
||||||
|
set(_MAN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/man/${_MAN}.8")
|
||||||
|
if(EXISTS "${_MAN_SRC}")
|
||||||
|
install(FILES "${_MAN_SRC}"
|
||||||
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
|
||||||
|
RENAME "${3PROXY_BINARY_PREFIX}${_MAN}.8"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
@@ -633,7 +918,8 @@ message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
|
|||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
message(STATUS " Options:")
|
message(STATUS " Options:")
|
||||||
message(STATUS " BUILD_SHARED: ${3PROXY_BUILD_SHARED}")
|
message(STATUS " BUILD_SHARED: ${3PROXY_BUILD_SHARED}")
|
||||||
message(STATUS " USE_OPENSSL: ${3PROXY_USE_OPENSSL}")
|
message(STATUS " USE_WOLFSSL: ${3PROXY_USE_WOLFSSL}")
|
||||||
|
message(STATUS " USE_OPENSSL: ${3PROXY_USE_OPENSSL}")
|
||||||
message(STATUS " USE_PCRE2: ${3PROXY_USE_PCRE2}")
|
message(STATUS " USE_PCRE2: ${3PROXY_USE_PCRE2}")
|
||||||
message(STATUS " USE_PAM: ${3PROXY_USE_PAM}")
|
message(STATUS " USE_PAM: ${3PROXY_USE_PAM}")
|
||||||
message(STATUS " USE_ODBC: ${3PROXY_USE_ODBC}")
|
message(STATUS " USE_ODBC: ${3PROXY_USE_ODBC}")
|
||||||
@@ -642,11 +928,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|||||||
message(STATUS " USE_SPLICE: ${3PROXY_USE_SPLICE}")
|
message(STATUS " USE_SPLICE: ${3PROXY_USE_SPLICE}")
|
||||||
message(STATUS " USE_NETFILTER: ${3PROXY_USE_NETFILTER}")
|
message(STATUS " USE_NETFILTER: ${3PROXY_USE_NETFILTER}")
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT WIN32 AND NOT APPLE)
|
||||||
|
message(STATUS " STATIC_LINK: ${3PROXY_STATIC_LINK}")
|
||||||
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
message(STATUS " USE_WSAPOLL: ${3PROXY_USE_WSAPOLL}")
|
message(STATUS " USE_WSAPOLL: ${3PROXY_USE_WSAPOLL}")
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
message(STATUS " Libraries found:")
|
message(STATUS " Libraries found:")
|
||||||
|
message(STATUS " wolfSSL: ${WOLFSSL_FOUND}")
|
||||||
message(STATUS " OpenSSL: ${OPENSSL_FOUND}")
|
message(STATUS " OpenSSL: ${OPENSSL_FOUND}")
|
||||||
message(STATUS " PCRE2: ${PCRE2_FOUND}")
|
message(STATUS " PCRE2: ${PCRE2_FOUND}")
|
||||||
message(STATUS " PAM: ${PAM_FOUND}")
|
message(STATUS " PAM: ${PAM_FOUND}")
|
||||||
@@ -654,3 +944,10 @@ message(STATUS " ODBC: ${ODBC_FOUND}")
|
|||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
message(STATUS " Plugins to build: ${ALL_PLUGINS}")
|
message(STATUS " Plugins to build: ${ALL_PLUGINS}")
|
||||||
message(STATUS "")
|
message(STATUS "")
|
||||||
|
message(STATUS " Standalone modules:")
|
||||||
|
message(STATUS " Binary prefix: \"${3PROXY_BINARY_PREFIX}\"")
|
||||||
|
foreach(_M proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr)
|
||||||
|
string(TOUPPER "${_M}" _MO)
|
||||||
|
message(STATUS " BUILD_${_MO}: ${3PROXY_BUILD_${_MO}}")
|
||||||
|
endforeach()
|
||||||
|
message(STATUS "")
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# 3proxy.busybox is fully functional 3proxy build based on busybox:musl
|
||||||
|
# built against wolfSSL and PCRE2.
|
||||||
|
#
|
||||||
|
# Examples are for podman, for docker change 'podman' to 'docker'
|
||||||
|
#
|
||||||
|
#to build:
|
||||||
|
# podman build -f Dockerfile.busybox -t 3proxy.busybox .
|
||||||
|
#to run:
|
||||||
|
#
|
||||||
|
# echo nserver 8.8.8.8 >/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# echo proxy -p3129 >>/path/to/local/config/directory/3proxy.cfg
|
||||||
|
# podman run --read-only -p 3129:3129 -v /path/to/local/config/directory:/etc/3proxy --name 3proxy.busybox 3proxy.busybox
|
||||||
|
#
|
||||||
|
# use "log" without pathname in config to log to stdout.
|
||||||
|
# plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config)
|
||||||
|
# symlinked as /lib and /lib64 in both root and chroot configurations, so no need
|
||||||
|
# to specify full path to plugin.
|
||||||
|
#
|
||||||
|
# Since 0.9.6 image is distroless, no reason to use chroot, chroot
|
||||||
|
# configuration is supported for compatibility only.
|
||||||
|
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS wolfssl
|
||||||
|
RUN apk add --no-cache build-base curl autoconf automake libtool linux-headers
|
||||||
|
RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
|
||||||
|
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p') && \
|
||||||
|
echo "wolfssl tag: $TAG" && \
|
||||||
|
curl -sL https://api.github.com/repos/wolfSSL/wolfssl/tarball/$TAG -o /tmp/w.tar.gz && \
|
||||||
|
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
|
||||||
|
cd /src && \
|
||||||
|
autoreconf -i && \
|
||||||
|
./configure --enable-opensslextra --enable-certgen \
|
||||||
|
--enable-tls13 --enable-sni --enable-session-ticket \
|
||||||
|
--enable-static --disable-shared --prefix=/usr/local && \
|
||||||
|
make -j$(nproc) && make install
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS buildenv
|
||||||
|
RUN apk add --no-cache gcc make musl-dev pcre2-dev
|
||||||
|
COPY --from=wolfssl /usr/local /usr/local
|
||||||
|
COPY . 3proxy
|
||||||
|
RUN cd 3proxy && mkdir -p bin &&\
|
||||||
|
make -f Makefile.Linux LIBSTATIC=true PAM_CHECK=false WOLFSSL_CHECK=true \
|
||||||
|
EXTRA_LDFLAGS="-L/usr/local/lib" &&\
|
||||||
|
strip bin/3proxy &&\
|
||||||
|
strip bin/*so &&\
|
||||||
|
mkdir /dist &&\
|
||||||
|
mkdir /dist/etc &&\
|
||||||
|
mkdir /dist/etc/3proxy &&\
|
||||||
|
mkdir /dist/bin &&\
|
||||||
|
mkdir /dist/usr &&\
|
||||||
|
mkdir /dist/usr/local &&\
|
||||||
|
mkdir /dist/usr/local/3proxy &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/conf &&\
|
||||||
|
mkdir /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp bin/3proxy /dist/bin &&\
|
||||||
|
cp bin/*.so /dist/usr/local/3proxy/libexec &&\
|
||||||
|
cp scripts/3proxy.cfg.inchroot /dist/etc/3proxy/3proxy.cfg
|
||||||
|
RUN cd /dist &&\
|
||||||
|
ln -s /lib lib64 &&\
|
||||||
|
ln -s /lib usr/lib &&\
|
||||||
|
ln -s /lib usr/lib64
|
||||||
|
RUN cp /lib/ld-musl-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
|
|
||||||
|
FROM docker.io/busybox:musl
|
||||||
|
COPY --from=buildenv /dist /
|
||||||
|
RUN mkdir -p /lib /lib64 && ln -sf /usr/local/3proxy/libexec/* /lib/ && cd /usr/local/3proxy/ && ln -s libexec lib && ln -s libexec lib64 && mkdir usr && ln -s libexec usr/lib && ln -s libexec usr/lib64
|
||||||
|
CMD ["/bin/3proxy", "/etc/3proxy/3proxy.cfg"]
|
||||||
+14
-18
@@ -1,29 +1,30 @@
|
|||||||
# 3proxy.full is fully functional 3proxy build based on busybox:glibc
|
# 3proxy.full is fully functional distroless 3proxy build
|
||||||
#
|
#
|
||||||
# Example are for podman, for docker change 'podman' to 'docker'
|
# Examples are for podman, for docker change 'podman' to 'docker'
|
||||||
#
|
#
|
||||||
#to build:
|
#to build:
|
||||||
# podman build -f Dockerfile.full -t 3proxy.full .
|
# podman build -f Dockerfile.full -t 3proxy.full .
|
||||||
#to run:
|
#to run:
|
||||||
#
|
#
|
||||||
# echo nserver 8.8.8.8 >/path/to/local/config/directory/3proxy.cfg
|
# echo nserver 8.8.8.8 >/path/to/local/config/directory/3proxy.cfg
|
||||||
# echo proxy -p3129 >>/path/to/local/config/directory/3proxy.cfg
|
# echo proxy -p3129 >>/path/to/local/config/directory/3proxy.cfg
|
||||||
# podman run --read-only -p 3129:3129 -v /path/to/local/config/directory:/etc/3proxy -name 3proxy.full 3proxy.full
|
# podman run --read-only -p 3129:3129 -v /path/to/local/config/directory:/etc/3proxy --name 3proxy.full 3proxy.full
|
||||||
#
|
#
|
||||||
# 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)
|
# plugins are located in /usr/local/3proxy/libexec (/libexec for chroot config)
|
||||||
# symlinked as /lib and /lib64 in both root and chroot configurations, so no need
|
# symlinked as /lib and /lib64 in both root and chroot configurations, so no need
|
||||||
# to specify full path to plugin. SSLPlugin is supported.
|
# to specify full path to plugin.
|
||||||
#
|
#
|
||||||
# Since 0.9.6 image is distroless, no reason to use chroot, chroot
|
# Since 0.9.6 image is distroless, no reason to use chroot, chroot
|
||||||
# configuration is supported for compatility only.
|
# configuration is supported for compatibility only.
|
||||||
|
|
||||||
|
|
||||||
FROM docker.io/gcc AS buildenv
|
FROM docker.io/gcc AS buildenv
|
||||||
COPY . 3proxy
|
COPY . 3proxy
|
||||||
RUN cd 3proxy &&\
|
RUN cd 3proxy &&\
|
||||||
apt --assume-yes update && apt --assume-yes install libssl-dev libpcre2-dev &&\
|
apt --assume-yes update && apt --assume-yes install libssl-dev libpcre2-dev &&\
|
||||||
make -f Makefile.Linux &&\
|
mkdir -p bin &&\
|
||||||
|
make -f Makefile.Linux LIBSTATIC=true PAM_CHECK=false &&\
|
||||||
strip bin/3proxy &&\
|
strip bin/3proxy &&\
|
||||||
mkdir /dist &&\
|
mkdir /dist &&\
|
||||||
mkdir /dist/etc &&\
|
mkdir /dist/etc &&\
|
||||||
@@ -42,15 +43,11 @@ RUN cd /dist &&\
|
|||||||
ln -s /usr/local/3proxy/libexec lib &&\
|
ln -s /usr/local/3proxy/libexec lib &&\
|
||||||
ln -s /usr/local/3proxy/libexec usr/lib &&\
|
ln -s /usr/local/3proxy/libexec usr/lib &&\
|
||||||
ln -s /usr/local/3proxy/libexec usr/lib64 &&\
|
ln -s /usr/local/3proxy/libexec usr/lib64 &&\
|
||||||
ln -s /usr/local/3proxy/libexec /dist/usr/local/3proxy/libexec/`gcc -dumpmachine` &&\
|
ln -s /usr/local/3proxy/libexec /dist/usr/local/3proxy/libexec/`gcc -dumpmachine`
|
||||||
cp /lib64/ld-*.so.* /dist/usr/local/3proxy/libexec &&\
|
RUN cp /lib/ld-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
cp "/lib/`gcc -dumpmachine`"/libc.so.* /dist/usr/local/3proxy/libexec &&\
|
RUN cp /lib64/ld-*.so.* /dist/usr/local/3proxy/libexec || true
|
||||||
cp "/lib/`gcc -dumpmachine`"/libdl.so.* /dist/usr/local/3proxy/libexec &&\
|
RUN cp "/lib/`gcc -dumpmachine`"/libc.so.* /dist/usr/local/3proxy/libexec &&\
|
||||||
cp "/lib/`gcc -dumpmachine`"/libcrypto.so.* /dist/usr/local/3proxy/libexec &&\
|
cp "/lib/`gcc -dumpmachine`"/libdl.so.* /dist/usr/local/3proxy/libexec
|
||||||
cp "/lib/`gcc -dumpmachine`"/libssl.so.* /dist/usr/local/3proxy/libexec &&\
|
|
||||||
cp "/lib/`gcc -dumpmachine`"/libpcre2-8.so.* /dist/usr/local/3proxy/libexec &&\
|
|
||||||
cp "/lib/`gcc -dumpmachine`"/libz.so.* /dist/usr/local/3proxy/libexec &&\
|
|
||||||
cp "/lib/`gcc -dumpmachine`"/libzstd.so.* /dist/usr/local/3proxy/libexec
|
|
||||||
RUN cd /dist/usr/local/3proxy/ &&\
|
RUN cd /dist/usr/local/3proxy/ &&\
|
||||||
ln -s libexec lib &&\
|
ln -s libexec lib &&\
|
||||||
ln -s libexec lib64 &&\
|
ln -s libexec lib64 &&\
|
||||||
@@ -58,8 +55,7 @@ RUN cd /dist/usr/local/3proxy/ &&\
|
|||||||
RUN cd /dist/usr/local/3proxy/usr &&\
|
RUN cd /dist/usr/local/3proxy/usr &&\
|
||||||
ln -s ../libexec lib &&\
|
ln -s ../libexec lib &&\
|
||||||
ln -s ../libexec lib64 &&\
|
ln -s ../libexec lib64 &&\
|
||||||
strip /dist/usr/local/3proxy/libexec/*.so &&\
|
strip /dist/usr/local/3proxy/libexec/*.so
|
||||||
ls -lR /dist
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=buildenv /dist /
|
COPY --from=buildenv /dist /
|
||||||
|
|||||||
+23
-7
@@ -3,10 +3,11 @@
|
|||||||
#
|
#
|
||||||
# Examples are for podman. For docker change 'podman' to 'docker'.
|
# Examples are for podman. For docker change 'podman' to 'docker'.
|
||||||
#
|
#
|
||||||
# This is busybox based docker with only 3proxy static executable.
|
# This is a scratch-based docker with statically linked 3proxy executable
|
||||||
|
# built against musl and wolfSSL.
|
||||||
#
|
#
|
||||||
# Limitations for minimal version:
|
# Limitations for minimal version:
|
||||||
# no support for plugins, IPv6, RADIUS, system resolver.
|
# no support for plugins and system resolver.
|
||||||
# 'nserver' or 'fakeresolve' are mandatory in configuration.
|
# 'nserver' or 'fakeresolve' are mandatory in configuration.
|
||||||
#
|
#
|
||||||
# Build:
|
# Build:
|
||||||
@@ -25,12 +26,27 @@
|
|||||||
#<end
|
#<end
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM docker.io/gcc AS buildenv
|
FROM docker.io/alpine:latest AS wolfssl
|
||||||
|
RUN apk add --no-cache build-base curl autoconf automake libtool linux-headers
|
||||||
|
RUN TAG=$(curl -s https://api.github.com/repos/wolfSSL/wolfssl/releases/latest \
|
||||||
|
| sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p') && \
|
||||||
|
echo "wolfssl tag: $TAG" && \
|
||||||
|
curl -sL https://api.github.com/repos/wolfSSL/wolfssl/tarball/$TAG -o /tmp/w.tar.gz && \
|
||||||
|
mkdir /src && tar -xzf /tmp/w.tar.gz -C /src --strip-components=1 && \
|
||||||
|
cd /src && \
|
||||||
|
autoreconf -i && \
|
||||||
|
./configure --enable-opensslextra --enable-certgen \
|
||||||
|
--enable-tls13 --enable-sni --enable-session-ticket \
|
||||||
|
--enable-static --disable-shared --prefix=/usr/local && \
|
||||||
|
make -j$(nproc) && make install
|
||||||
|
|
||||||
|
FROM docker.io/alpine:latest AS buildenv
|
||||||
|
RUN apk add --no-cache gcc make musl-dev
|
||||||
|
COPY --from=wolfssl /usr/local /usr/local
|
||||||
COPY . 3proxy
|
COPY . 3proxy
|
||||||
RUN cd 3proxy &&\
|
RUN cd 3proxy && mkdir -p bin &&\
|
||||||
export "LDFLAGS=-static" &&\
|
make -f Makefile.Linux STATIC=true WOLFSSL_CHECK=true \
|
||||||
export "CFLAGS=-DNOPLUGINS -DNORADIUS -DNOIPV6 -DNOODBC -DNOCRYPT -DNOSTDRESOLVE" &&\
|
EXTRA_LDFLAGS="-L/usr/local/lib" &&\
|
||||||
make -f Makefile.Linux PLUGINS= LIBS= &&\
|
|
||||||
strip bin/3proxy
|
strip bin/3proxy
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|||||||
+78
-20
@@ -1,16 +1,26 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Unix
|
# 3 proxy Makefile for GCC/Unix
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
MANDIR ?= /usr/share/man
|
||||||
CC ?= cc
|
CC ?= cc
|
||||||
|
|
||||||
CFLAGS := -c -fno-strict-aliasing -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -c -fno-strict-aliasing -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_UN
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= ${CC}
|
LN ?= ${CC}
|
||||||
|
LDFLAGS ?= -O3 -flto
|
||||||
LDFLAGS += -pthread -fno-strict-aliasing
|
LDFLAGS += -pthread -fno-strict-aliasing
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
# -lpthreads may be reuiured on some platforms instead of -pthreads
|
# -lpthreads may be reuiured on some platforms instead of -pthreads
|
||||||
# -ldl or -lld may be required for some platforms
|
# -ldl or -lld may be required for some platforms
|
||||||
DCFLAGS ?= -fPIC
|
DCFLAGS ?= -fPIC
|
||||||
@@ -29,35 +39,83 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Mak
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.FreeBSD
|
MAKEFILE = Makefile.FreeBSD
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
WOLFSSL_CHECK ?= $(shell echo "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX)
|
||||||
PLUGINS += SSLPlugin
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -lpcre2-8 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -lpcre2-8 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
ifeq ($(PCRE_CHECK), true)
|
ifeq ($(PCRE_CHECK), true)
|
||||||
PLUGINS += PCREPlugin
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
PAM_CHECK ?= $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
ifeq ($(PAM_CHECK), true)
|
ifeq ($(PAM_CHECK), true)
|
||||||
PLUGINS += PamAuth
|
PLUGINS += PamAuth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
prefix ?= /usr/local
|
||||||
|
BINPREFIX ?= $(prefix)/bin
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
if [ ! -d "/usr/local/3proxy/bin" ]; then mkdir -p /usr/local/3proxy/bin/; fi
|
if [ ! -d "$(DESTDIR)$(BINPREFIX)" ]; then mkdir -p $(DESTDIR)$(BINPREFIX)/; fi
|
||||||
install bin/3proxy /usr/local/3proxy/bin/3proxy
|
install bin/3proxy $(DESTDIR)$(BINPREFIX)/3proxy
|
||||||
install bin/mycrypt /usr/local/3proxy/bin/mycrypt
|
install bin/$(CRYPT_PREFIX)crypt $(DESTDIR)$(BINPREFIX)/$(CRYPT_PREFIX)crypt
|
||||||
install scripts/rc.d/3proxy /usr/local/etc/rc.d/3proxy
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
install scripts/add3proxyuser.sh /usr/local/3proxy/bin/
|
if [ -f bin/$(PREFIX)$$f ]; then install bin/$(PREFIX)$$f $(DESTDIR)$(BINPREFIX)/$(PREFIX)$$f; fi; \
|
||||||
if [ -s /usr/local/etc/3proxy/3proxy.cfg ]; then /usr/local/3proxy/3proxy.cfg already exists ; else install scripts/3proxy.cfg /usr/local/etc/3proxy/; fi
|
done
|
||||||
if [ ! -d /var/log/3proxy/ ]; then mkdir /var/log/3proxy/; fi
|
install -d $(DESTDIR)$(prefix)/etc/3proxy/conf
|
||||||
touch /usr/local/3proxy/passwd
|
install -d $(DESTDIR)$(prefix)/etc/rc.d/
|
||||||
touch /usr/local/3proxy/counters
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' scripts/rc.d/3proxy.in > $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
touch /usr/local/3proxy/bandlimiters
|
chmod 755 $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
echo Run /usr/local/3proxy/bin/add3proxyuser.sh to add \'admin\' user
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|$(CRYPT_PREFIX)|g' scripts/add3proxyuser.sh.in > $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
chmod 755 $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
if [ -s $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg ]; then echo $(prefix)/etc/3proxy/3proxy.cfg already exists; else sed -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@3PROXY_COUNTERDIR@|/opt/3proxy|g' scripts/3proxy.cfg.in > $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; chmod 640 $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; fi
|
||||||
|
if [ ! -d $(DESTDIR)/var/log/3proxy/ ]; then mkdir -p $(DESTDIR)/var/log/3proxy/; fi
|
||||||
|
mkdir -p $(DESTDIR)/opt/3proxy
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/passwd
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/counters
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/bandlimiters
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man8
|
||||||
|
install -m 644 man/3proxy.8 $(DESTDIR)$(MANDIR)/man8/3proxy.8
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ]; then install -m 644 man/$$f.8 $(DESTDIR)$(MANDIR)/man8/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
install -m 644 man/3proxy_crypt.8 $(DESTDIR)$(MANDIR)/man8/$(CRYPT_PREFIX)crypt.8
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man5
|
||||||
|
install -m 644 man/3proxy.cfg.5 $(DESTDIR)$(MANDIR)/man5/3proxy.cfg.5
|
||||||
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
|
sh scripts/postinstall.sh $(prefix); \
|
||||||
|
fi
|
||||||
|
echo Run $(BINPREFIX)/add3proxyuser to add \'admin\' user
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
+82
-44
@@ -1,17 +1,30 @@
|
|||||||
#
|
#
|
||||||
# 3 proxy Makefile for GCC/Linux/Cygwin
|
# 3 proxy Makefile for GCC/Linux/Cygwin
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -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
|
||||||
|
# read/write path for most traffic. Add -DWITHSPLICE to CFLAGS to build it,
|
||||||
|
# it must additionally be enabled per service with the -s option.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
CFLAGS := -g -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER $(CFLAGS)
|
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
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= ${CC}
|
LN ?= ${CC}
|
||||||
DCFLAGS ?=
|
DCFLAGS ?= -fPIC
|
||||||
LDFLAGS := -fPIC -O2 -fno-strict-aliasing -pthread $(LDFLAGS)
|
LDFLAGS ?= -O3 -flto
|
||||||
|
LDFLAGS += -fno-strict-aliasing -pthread
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
DLFLAGS ?= -shared
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .ld.so
|
DLSUFFICS = .ld.so
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
@@ -30,19 +43,46 @@ MAKEFILE = Makefile.Linux
|
|||||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
# PamAuth requires libpam, you may require pam-devel package to be installed
|
||||||
# SSLPlugin requires -lcrypto -lssl
|
# SSLPlugin requires -lcrypto -lssl
|
||||||
#LIBS = -lcrypto -lssl -ldl
|
#LIBS = -lcrypto -lssl -ldl
|
||||||
LIBS ?= -ldl
|
|
||||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
else
|
||||||
|
LIBS += -ldl
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
|
||||||
|
WOLFSSL_CHECK ?= $(shell echo "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX)
|
||||||
PLUGINS += SSLPlugin
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -lpcre2-8 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
ifeq ($(PCRE_CHECK), true)
|
ifeq ($(PCRE_CHECK), true)
|
||||||
PLUGINS += PCREPlugin
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
PAM_CHECK ?= $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
ifeq ($(PAM_CHECK), true)
|
ifeq ($(PAM_CHECK), true)
|
||||||
PLUGINS += PamAuth
|
PLUGINS += PamAuth
|
||||||
endif
|
endif
|
||||||
@@ -51,45 +91,43 @@ include Makefile.inc
|
|||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
|
|
||||||
DESTDIR =
|
DESTDIR ?=
|
||||||
prefix =
|
prefix ?=
|
||||||
exec_prefix = $(prefix)
|
exec_prefix ?= $(prefix)
|
||||||
man_prefix = /usr/share
|
man_prefix ?= /usr/share
|
||||||
chroot_prefix = /usr/local
|
chroot_prefix ?= /usr/local
|
||||||
|
|
||||||
INSTALL = /usr/bin/install
|
INSTALL ?= /usr/bin/install
|
||||||
INSTALL_BIN = $(INSTALL) -m 755
|
INSTALL_BIN = $(INSTALL) -m 755
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
INSTALL_DATA = $(INSTALL) -m 644
|
||||||
INSTALL_OBJS = bin/3proxy \
|
INSTALL_OBJS = bin/3proxy \
|
||||||
bin/ftppr \
|
bin/$(CRYPT_PREFIX)crypt \
|
||||||
bin/mycrypt \
|
bin/$(PREFIX)ftppr \
|
||||||
bin/pop3p \
|
bin/$(PREFIX)imapp \
|
||||||
bin/proxy \
|
bin/$(PREFIX)pop3p \
|
||||||
bin/socks \
|
bin/$(PREFIX)proxy \
|
||||||
bin/tcppm \
|
bin/$(PREFIX)smtpp \
|
||||||
bin/udppm \
|
bin/$(PREFIX)socks \
|
||||||
bin/tlspr
|
bin/$(PREFIX)tcppm \
|
||||||
|
bin/$(PREFIX)tlspr \
|
||||||
|
bin/$(PREFIX)udppm
|
||||||
|
|
||||||
|
|
||||||
INSTALL_CFG = scripts/3proxy.cfg.chroot
|
INSTALL_CFG = scripts/3proxy.cfg.chroot
|
||||||
INSTALL_CFG_INCHROOT = scripts/3proxy.cfg.inchroot
|
INSTALL_CFG_INCHROOT = scripts/3proxy.cfg.inchroot
|
||||||
INSTALL_CFG_OBJS = scripts/add3proxyuser.sh
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS2 = counters bandlimiters
|
INSTALL_CFG_OBJS2 = counters bandlimiters
|
||||||
|
|
||||||
INSTALL_INITD_SCRIPT = scripts/init.d/3proxy.sh
|
INSTALL_INITD_SCRIPT = scripts/init.d/3proxy.in
|
||||||
INSTALL_SYSTEMD_SCRIPT = scripts/3proxy.service
|
INSTALL_SYSTEMD_SCRIPT = scripts/3proxy.service.in
|
||||||
|
|
||||||
CHROOTDIR = $(DESTDIR)$(chroot_prefix)/3proxy
|
CHROOTDIR = $(DESTDIR)$(chroot_prefix)/3proxy
|
||||||
CHROOTREL = ../..$(chroot_prefix)/3proxy
|
CHROOTREL = ../..$(chroot_prefix)/3proxy
|
||||||
MANDIR1 = $(DESTDIR)$(man_prefix)/man/man1
|
MANDIR5 = $(DESTDIR)$(man_prefix)/man/man5
|
||||||
MANDIR3 = $(DESTDIR)$(man_prefix)/man/man3
|
|
||||||
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
||||||
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
||||||
ETCDIR = $(DESTDIR)/etc/3proxy
|
ETCDIR = $(DESTDIR)/etc/3proxy
|
||||||
INITDDIR = $(DESTDIR)/etc/init.d
|
INITDDIR = $(DESTDIR)/etc/init.d
|
||||||
RUNBASE = $(DESTDIR)/var/run
|
|
||||||
RUNDIR = $(RUNBASE)/3proxy
|
|
||||||
LOGBASE = $(DESTDIR)/var/log
|
LOGBASE = $(DESTDIR)/var/log
|
||||||
LOGDIR = $(LOGBASE)/3proxy
|
LOGDIR = $(LOGBASE)/3proxy
|
||||||
INSTALL_CFG_DEST = $(ETCDIR)/conf
|
INSTALL_CFG_DEST = $(ETCDIR)/conf
|
||||||
@@ -99,6 +137,7 @@ install-bin:
|
|||||||
$(INSTALL_BIN) -d $(BINDIR)
|
$(INSTALL_BIN) -d $(BINDIR)
|
||||||
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
||||||
$(INSTALL_BIN) -s bin/*.ld.so $(CHROOTDIR)/libexec
|
$(INSTALL_BIN) -s bin/*.ld.so $(CHROOTDIR)/libexec
|
||||||
|
$(INSTALL_BIN) scripts/add3proxyuser.sh.in $(BINDIR)/add3proxyuser
|
||||||
|
|
||||||
install-etc-dir:
|
install-etc-dir:
|
||||||
$(INSTALL_BIN) -d $(ETCDIR)
|
$(INSTALL_BIN) -d $(ETCDIR)
|
||||||
@@ -109,13 +148,11 @@ install-chroot-dir:
|
|||||||
$(INSTALL_BIN) -d $(CHROOTDIR)/logs
|
$(INSTALL_BIN) -d $(CHROOTDIR)/logs
|
||||||
$(INSTALL_BIN) -d $(CHROOTDIR)/count
|
$(INSTALL_BIN) -d $(CHROOTDIR)/count
|
||||||
$(INSTALL_BIN) -d $(CHROOTDIR)/libexec
|
$(INSTALL_BIN) -d $(CHROOTDIR)/libexec
|
||||||
chmod -R o-rwx $(CHROOTDIR)
|
|
||||||
|
|
||||||
install-etc-default-config: install-chroot-dir
|
install-etc-default-config: install-chroot-dir
|
||||||
if [ ! -d $(INSTALL_CFG_DEST) ]; then \
|
if [ ! -d $(INSTALL_CFG_DEST) ]; then \
|
||||||
ln -s $(CHROOTREL)/conf $(INSTALL_CFG_DEST); \
|
ln -s $(CHROOTREL)/conf $(INSTALL_CFG_DEST); \
|
||||||
$(INSTALL_BIN) $(INSTALL_CFG) $(ETCDIR)/3proxy.cfg; \
|
$(INSTALL_BIN) $(INSTALL_CFG) $(ETCDIR)/3proxy.cfg; \
|
||||||
$(INSTALL_BIN) $(INSTALL_CFG_OBJS) $(INSTALL_CFG_DEST); \
|
|
||||||
$(INSTALL_BIN) $(INSTALL_CFG_INCHROOT) $(INSTALL_CFG_DEST)/3proxy.cfg; \
|
$(INSTALL_BIN) $(INSTALL_CFG_INCHROOT) $(INSTALL_CFG_DEST)/3proxy.cfg; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -126,19 +163,20 @@ install-etc: install-etc-dir install-etc-default-config
|
|||||||
done;
|
done;
|
||||||
|
|
||||||
install-man:
|
install-man:
|
||||||
$(INSTALL_BIN) -d $(MANDIR3)
|
$(INSTALL_BIN) -d $(MANDIR5)
|
||||||
$(INSTALL_BIN) -d $(MANDIR8)
|
$(INSTALL_BIN) -d $(MANDIR8)
|
||||||
$(INSTALL_DATA) man/*.3 $(MANDIR3)
|
$(INSTALL_DATA) man/3proxy.cfg.5 $(MANDIR5)
|
||||||
$(INSTALL_DATA) man/*.8 $(MANDIR8)
|
$(INSTALL_DATA) man/3proxy.8 $(MANDIR8)
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ]; then $(INSTALL_DATA) man/$$f.8 $(MANDIR8)/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
$(INSTALL_DATA) man/3proxy_crypt.8 $(MANDIR8)/$(CRYPT_PREFIX)crypt.8
|
||||||
|
|
||||||
install-init:
|
install-init:
|
||||||
|
$(INSTALL_BIN) -d $(SYSTEMDDIR)
|
||||||
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(exec_prefix)/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' $(INSTALL_SYSTEMD_SCRIPT) > $(SYSTEMDDIR)/3proxy.service
|
||||||
$(INSTALL_BIN) -d $(INITDDIR)
|
$(INSTALL_BIN) -d $(INITDDIR)
|
||||||
$(INSTALL_BIN) $(INSTALL_INITD_SCRIPT) $(INITDDIR)/3proxy
|
$(INSTALL_BIN) $(INSTALL_INITD_SCRIPT) $(INITDDIR)/3proxy
|
||||||
$(INSTALL_BIN) -d $(SYSTEMDDIR)
|
|
||||||
$(INSTALL_DATA) $(INSTALL_SYSTEMD_SCRIPT) $(SYSTEMDDIR)
|
|
||||||
|
|
||||||
install-run:
|
|
||||||
$(INSTALL_BIN) -d $(RUNDIR)
|
|
||||||
|
|
||||||
install-log:
|
install-log:
|
||||||
$(INSTALL_BIN) -d $(LOGBASE)
|
$(INSTALL_BIN) -d $(LOGBASE)
|
||||||
@@ -146,7 +184,7 @@ install-log:
|
|||||||
ln -s $(CHROOTREL)/logs $(LOGDIR);\
|
ln -s $(CHROOTREL)/logs $(LOGDIR);\
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install: install-chroot-dir install-bin install-etc install-log install-man install-run install-init
|
install: install-chroot-dir install-bin install-etc install-log install-man install-init
|
||||||
@if [ "$(DESTDIR)" = "" ]; then \
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
sh debian/preinst; \
|
sh debian/preinst; \
|
||||||
sh debian/postinst; \
|
sh debian/postinst; \
|
||||||
|
|||||||
+26
-4
@@ -2,12 +2,14 @@
|
|||||||
# 3 proxy Makefile for Solaris/SunCC
|
# 3 proxy Makefile for Solaris/SunCC
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
CC = cc
|
PREFIX ?= 3proxy_
|
||||||
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
CC ?= cc
|
||||||
|
CFLAGS = -xO3 -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL
|
||||||
COUT = -o ./
|
COUT = -o ./
|
||||||
LN = $(CC)
|
LN = $(CC)
|
||||||
LDFLAGS = -xO3
|
LDFLAGS = -xO3
|
||||||
@@ -27,7 +29,27 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Mak
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.Solaris
|
MAKEFILE = Makefile.Solaris
|
||||||
PLUGINS = StringsPlugin TrafficPlugin
|
PLUGINS = StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
||||||
|
|
||||||
|
WOLFSSL_CHECK = $(shell echo "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testwssl testwssl.o -lwolfssl 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += -lwolfssl
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += -l crypto -l ssl
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
|
ifeq ($(PCRE_CHECK), true)
|
||||||
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = -Wl,-Bstatic -lpcre2-8 -Wl,-Bdynamic
|
||||||
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Solaris/gcc
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = gcc
|
|
||||||
CFLAGS = -O2 -fno-strict-aliasing -c -D_SOLARIS -D_THREAD_SAFE -DGETHOSTBYNAME_R -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL
|
|
||||||
COUT = -o ./
|
|
||||||
LN = $(CC)
|
|
||||||
LDFLAGS = -O3
|
|
||||||
DCFLAGS = -fPIC
|
|
||||||
DLFLAGS = -shared
|
|
||||||
DLSUFFICS = .ld.so
|
|
||||||
LIBS = -lpthread -lsocket -lnsl -lresolv -ldl
|
|
||||||
LIBSPREFIX = -l
|
|
||||||
LIBSSUFFIX =
|
|
||||||
LNOUT = -o ./
|
|
||||||
EXESUFFICS =
|
|
||||||
OBJSUFFICS = .o
|
|
||||||
DEFINEOPTION = -D
|
|
||||||
COMPFILES = *~
|
|
||||||
REMOVECOMMAND = rm -f
|
|
||||||
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
|
||||||
TYPECOMMAND = cat
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.Solaris-gcc
|
|
||||||
PLUGINS = StringsPlugin TrafficPlugin
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
SUBDIRS = src man
|
|
||||||
EXTRA_DIST = doc cfg
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
|
||||||
#
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = cl
|
|
||||||
CFLAGS = /FD /MDd /nologo /W3 /ZI /Wp64 /GS /Gs /RTCsu /EHs- /GA /GF /DEBUG /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /c
|
|
||||||
COUT = /Fo
|
|
||||||
LN = link
|
|
||||||
LDFLAGS = /nologo /subsystem:console /machine:I386 /DEBUG
|
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib
|
|
||||||
LNOUT = /out:
|
|
||||||
EXESUFFICS = .exe
|
|
||||||
OBJSUFFICS = .obj
|
|
||||||
DEFINEOPTION = /D
|
|
||||||
COMPFILES = *.pch *.idb
|
|
||||||
REMOVECOMMAND = del 2>NUL >NUL
|
|
||||||
TYPECOMMAND = type
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.debug
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
+15
-3
@@ -2,19 +2,29 @@
|
|||||||
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
# 3 proxy Makefile for Microsoft Visual C compiler (for both make and nmake)
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
# ODBC support is enabled by default on Windows (/D WITH_ODBC, odbc32.lib)
|
||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX = 3proxy_
|
||||||
|
CRYPT_PREFIX = 3proxy_
|
||||||
CC = cl
|
CC = cl
|
||||||
VERSION = $(VERSION)
|
VERSION = $(VERSION)
|
||||||
BUILDDATE = $(BUILDDATE)
|
BUILDDATE = $(BUILDDATE)
|
||||||
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" /D "WITH_SSL" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c $(BUILDDATE) $(VERSION)
|
!IFDEF WOLFSSL
|
||||||
|
SSL_DEFS = /D "WITH_SSL" /D "WITH_WOLFSSL"
|
||||||
|
SSL_LIBS = wolfssl.lib
|
||||||
|
!ELSE
|
||||||
|
SSL_DEFS = /D "WITH_SSL"
|
||||||
|
SSL_LIBS = libcrypto.lib libssl.lib
|
||||||
|
!ENDIF
|
||||||
|
CFLAGS = /nologo /MT /W3 /Ox /GS /EHs- /GA /GF /D "MSVC" /D "WITH_WSAPOLL" /D "NDEBUG" /D "WIN32" $(SSL_DEFS) /D "WITH_PCRE" /D "WITH_ODBC" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /Fp"proxy.pch" /FD /c $(BUILDDATE) $(VERSION)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib libcrypto.lib libssl.lib
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib Crypt32.lib $(SSL_LIBS) pcre2-8.lib
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
@@ -27,7 +37,9 @@ REMOVECOMMAND = del
|
|||||||
TYPECOMMAND = type
|
TYPECOMMAND = type
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.msvc
|
MAKEFILE = Makefile.msvc
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin SSLPlugin PCREPlugin
|
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
VERFILE = 3proxy.res $(VERFILE)
|
VERFILE = 3proxy.res $(VERFILE)
|
||||||
VERSIONDEP = 3proxy.res $(VERSIONDEP)
|
VERSIONDEP = 3proxy.res $(VERSIONDEP)
|
||||||
AFTERCLEAN = if exist src\*.res (del src\*.res) && if exist src\*.err (del src\*.err)
|
AFTERCLEAN = if exist src\*.res (del src\*.res) && if exist src\*.err (del src\*.err)
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
#
|
|
||||||
# 3 proxy Makefile for GCC/Linux/Cygwin
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LIBS to compile with ODBC
|
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
|
||||||
CC = mips-openwrt-linux-gcc
|
|
||||||
|
|
||||||
CFLAGS ?= -g -O2 -fno-strict-aliasing -c -pthread -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
|
|
||||||
COUT = -o
|
|
||||||
LN = $(CC)
|
|
||||||
DCFLAGS = -fPIC
|
|
||||||
LDFLAGS ?= -O2 -fno-strict-aliasing -pthread -s
|
|
||||||
DLFLAGS = -shared
|
|
||||||
DLSUFFICS = .ld.so
|
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
|
||||||
LIBSPREFIX = -l
|
|
||||||
LIBSSUFFIX =
|
|
||||||
LNOUT = -o
|
|
||||||
EXESUFFICS =
|
|
||||||
OBJSUFFICS = .o
|
|
||||||
DEFINEOPTION = -D
|
|
||||||
COMPFILES = *~
|
|
||||||
REMOVECOMMAND = rm -f
|
|
||||||
AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
|
||||||
TYPECOMMAND = cat
|
|
||||||
COMPATLIBS =
|
|
||||||
MAKEFILE = Makefile.openwrt-mips
|
|
||||||
# PamAuth requires libpam, you may require pam-devel package to be installed
|
|
||||||
# SSLPlugin requires -lcrypto -lssl
|
|
||||||
#LIBS = -lcrypto -lssl -ldl
|
|
||||||
LIBS ?= -ldl
|
|
||||||
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin PamAuth
|
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
|
||||||
LIBS += -l crypto -l ssl
|
|
||||||
PLUGINS += SSLPlugin
|
|
||||||
endif
|
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
|
||||||
ifeq ($(PCRE_CHECK), true)
|
|
||||||
PLUGINS += PCREPlugin
|
|
||||||
endif
|
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
|
||||||
ifeq ($(PAM_CHECK), true)
|
|
||||||
PLUGINS += PamAuth
|
|
||||||
endif
|
|
||||||
|
|
||||||
include Makefile.inc
|
|
||||||
|
|
||||||
allplugins:
|
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
|
||||||
|
|
||||||
DESTDIR =
|
|
||||||
prefix = /usr/local
|
|
||||||
exec_prefix = $(prefix)
|
|
||||||
man_prefix = $(prefix)/share
|
|
||||||
|
|
||||||
INSTALL = /usr/bin/install
|
|
||||||
INSTALL_BIN = $(INSTALL) -m 755
|
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
|
||||||
INSTALL_OBJS = src/3proxy \
|
|
||||||
src/ftppr \
|
|
||||||
src/mycrypt \
|
|
||||||
src/pop3p \
|
|
||||||
src/proxy \
|
|
||||||
src/socks \
|
|
||||||
src/tcppm \
|
|
||||||
src/udppm
|
|
||||||
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS = scripts/3proxy.cfg \
|
|
||||||
scripts/add3proxyuser.sh
|
|
||||||
INSTALL_CFG_DEST = config
|
|
||||||
|
|
||||||
INSTALL_CFG_OBJS2 = passwd counters bandlimiters
|
|
||||||
|
|
||||||
MANDIR1 = $(DESTDIR)$(man_prefix)/man/man1
|
|
||||||
MANDIR3 = $(DESTDIR)$(man_prefix)/man/man3
|
|
||||||
MANDIR8 = $(DESTDIR)$(man_prefix)/man/man8
|
|
||||||
BINDIR = $(DESTDIR)$(exec_prefix)/bin
|
|
||||||
ETCDIR = $(DESTDIR)$(prefix)/etc/3proxy
|
|
||||||
|
|
||||||
install-bin:
|
|
||||||
$(INSTALL_BIN) -d $(BINDIR)
|
|
||||||
$(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
|
|
||||||
|
|
||||||
install-etc-dir:
|
|
||||||
$(INSTALL_BIN) -d $(ETCDIR)
|
|
||||||
|
|
||||||
install-etc-default-config:
|
|
||||||
if [ -f $(ETCDIR)/$(INSTALL_CFG_DEST) ]; then \
|
|
||||||
: ; \
|
|
||||||
else \
|
|
||||||
$(INSTALL_DATA) $(INSTALL_CFG_OBJS) $(ETCDIR)/$(INSTALL_CFG_DEST) \
|
|
||||||
fi
|
|
||||||
|
|
||||||
install-etc: install-etc-dir
|
|
||||||
for file in $(INSTALL_CFG_OBJS2); \
|
|
||||||
do \
|
|
||||||
touch $(ETCDIR)/$$file; chmod 0600 $(ETCDIR)/$$file; \
|
|
||||||
done;
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
$(INSTALL_BIN) -d $(MANDIR3)
|
|
||||||
$(INSTALL_BIN) -d $(MANDIR8)
|
|
||||||
$(INSTALL_DATA) man/*.3 $(MANDIR3)
|
|
||||||
$(INSTALL_DATA) man/*.8 $(MANDIR8)
|
|
||||||
|
|
||||||
install: install-bin install-etc install-man
|
|
||||||
|
|
||||||
+79
-21
@@ -2,17 +2,27 @@
|
|||||||
# 3 proxy Makefile for GCC/Unix
|
# 3 proxy Makefile for GCC/Unix
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# add -DWITH_ODBC to CFLAGS and -lodbc to LDFLAGS to compile with ODBC
|
||||||
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
# library support. Add -DSAFESQL for poorely written ODBC library / drivers.
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
|
MANDIR ?= /usr/share/man
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
|
|
||||||
# you may need -L/usr/pkg/lib for older NetBSD versions
|
# you may need -L/usr/pkg/lib for older NetBSD versions
|
||||||
CFLAGS := -g -O2 -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DFD_SETSIZE=4096 -DWITH_POLL $(CFLAGS)
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -fno-strict-aliasing -c -pthread -D_THREAD_SAFE -D_REENTRANT -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_UN
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= $(CC)
|
LN ?= $(CC)
|
||||||
LDFLAGS ?= -O2 -fno-strict-aliasing -pthread
|
LDFLAGS ?= -O3 -flto
|
||||||
|
LDFLAGS += -pthread -fno-strict-aliasing
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
# -ldl or -lld may be required for some platforms
|
# -ldl or -lld may be required for some platforms
|
||||||
DCFLAGS ?= -fPIC
|
DCFLAGS ?= -fPIC
|
||||||
@@ -31,35 +41,83 @@ AFTERCLEAN = (find . -type f -name "*.o" -delete && find src/ -type f -name "Mak
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.unix
|
MAKEFILE = Makefile.unix
|
||||||
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin
|
PLUGINS ?= StringsPlugin TrafficPlugin TransparentPlugin FilePlugin
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o -lcrypto -lssl 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
ifeq ($(STATIC), true)
|
||||||
|
LDFLAGS += -static
|
||||||
|
CFLAGS += -DNOPLUGINS -DNOSTDRESOLVE -DNOCRYPT
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
PLUGINS =
|
||||||
|
PAM_CHECK = false
|
||||||
|
endif
|
||||||
|
ifeq ($(LIBSTATIC), true)
|
||||||
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
|
ZLIB = -lz -lzstd
|
||||||
|
endif
|
||||||
|
WOLFSSL_CHECK ?= $(shell echo "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testwssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestwssl testwssl.o $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) 2>/dev/null && rm testwssl testwssl.o && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX)
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK ?= $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testssl.o - 2>/dev/null && $(CC) $(LDFLAGS) -otestssl testssl.o $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX) 2>/dev/null && rm testssl testssl.o && echo true||echo false)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
LIBS += -l crypto -l ssl
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -lcrypto -lssl $(STATIC_SUFFIX)
|
||||||
PLUGINS += SSLPlugin
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) -lpcre2-8 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
endif
|
||||||
|
PCRE_CHECK ?= $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n\#include <pcre2.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpcre.o - 2>/dev/null && $(CC) -o testpcre testpcre.o $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) 2>/dev/null && rm testpcre testpcre.o && echo true||echo false)
|
||||||
ifeq ($(PCRE_CHECK), true)
|
ifeq ($(PCRE_CHECK), true)
|
||||||
PLUGINS += PCREPlugin
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
PAM_CHECK ?= $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d \\\\ | $(CC) -x c $(CFLAGS) -o testpam.o - 2>/dev/null && $(CC) $(LDFLAGS) -o testpam testpam.o -lpam 2>/dev/null && rm testpam testpam.o && echo true||echo false)
|
||||||
ifeq ($(PAM_CHECK), true)
|
ifeq ($(PAM_CHECK), true)
|
||||||
PLUGINS += PamAuth
|
PLUGINS += PamAuth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
prefix ?= /usr/local
|
||||||
|
BINPREFIX ?= $(prefix)/bin
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
if [ ! -d "/usr/local/3proxy/bin" ]; then mkdir -p /usr/local/3proxy/bin/; fi
|
if [ ! -d "$(DESTDIR)$(BINPREFIX)" ]; then mkdir -p $(DESTDIR)$(BINPREFIX)/; fi
|
||||||
install bin/3proxy /usr/local/3proxy/bin/3proxy
|
install bin/3proxy $(DESTDIR)$(BINPREFIX)/3proxy
|
||||||
install bin/mycrypt /usr/local/3proxy/bin/mycrypt
|
install bin/$(CRYPT_PREFIX)crypt $(DESTDIR)$(BINPREFIX)/$(CRYPT_PREFIX)crypt
|
||||||
install scripts/rc.d/3proxy /usr/local/etc/rc.d/3proxy
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
install scripts/add3proxyuser.sh /usr/local/3proxy/bin/
|
if [ -f bin/$(PREFIX)$$f ]; then install bin/$(PREFIX)$$f $(DESTDIR)$(BINPREFIX)/$(PREFIX)$$f; fi; \
|
||||||
if [ -s /usr/local/etc/3proxy/3proxy.cfg ]; then /usr/local/3proxy/3proxy.cfg already exists ; else install scripts/3proxy.cfg /usr/local/etc/3proxy/; fi
|
done
|
||||||
if [ ! -d /var/log/3proxy/ ]; then mkdir /var/log/3proxy/; fi
|
install -d $(DESTDIR)$(prefix)/etc/3proxy/conf
|
||||||
touch /usr/local/3proxy/passwd
|
install -d $(DESTDIR)$(prefix)/etc/rc.d/
|
||||||
touch /usr/local/3proxy/counters
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' scripts/rc.d/3proxy.in > $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
touch /usr/local/3proxy/bandlimiters
|
chmod 755 $(DESTDIR)$(prefix)/etc/rc.d/3proxy
|
||||||
echo Run /usr/local/3proxy/bin/add3proxyuser.sh to add \'admin\' user
|
sed -e 's|@CMAKE_INSTALL_FULL_BINDIR@|$(BINPREFIX)|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|$(CRYPT_PREFIX)|g' scripts/add3proxyuser.sh.in > $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
chmod 755 $(DESTDIR)$(BINPREFIX)/add3proxyuser
|
||||||
|
if [ -s $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg ]; then echo $(prefix)/etc/3proxy/3proxy.cfg already exists; else sed -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|$(prefix)/etc|g' -e 's|@3PROXY_CONFDIR@|$(prefix)/etc/3proxy/conf|g' -e 's|@3PROXY_COUNTERDIR@|/opt/3proxy|g' scripts/3proxy.cfg.in > $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; chmod 640 $(DESTDIR)$(prefix)/etc/3proxy/3proxy.cfg; fi
|
||||||
|
if [ ! -d $(DESTDIR)/var/log/3proxy/ ]; then mkdir -p $(DESTDIR)/var/log/3proxy/; fi
|
||||||
|
mkdir -p $(DESTDIR)/opt/3proxy
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/passwd
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/counters
|
||||||
|
touch $(DESTDIR)$(prefix)/etc/3proxy/conf/bandlimiters
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man8
|
||||||
|
install -m 644 man/3proxy.8 $(DESTDIR)$(MANDIR)/man8/3proxy.8
|
||||||
|
for f in proxy socks pop3p imapp smtpp ftppr tcppm udppm tlspr; do \
|
||||||
|
if [ -f man/$$f.8 ]; then install -m 644 man/$$f.8 $(DESTDIR)$(MANDIR)/man8/$(PREFIX)$$f.8; fi; \
|
||||||
|
done
|
||||||
|
install -m 644 man/3proxy_crypt.8 $(DESTDIR)$(MANDIR)/man8/$(CRYPT_PREFIX)crypt.8
|
||||||
|
install -d $(DESTDIR)$(MANDIR)/man5
|
||||||
|
install -m 644 man/3proxy.cfg.5 $(DESTDIR)$(MANDIR)/man5/3proxy.cfg.5
|
||||||
|
@if [ "$(DESTDIR)" = "" ]; then \
|
||||||
|
sh scripts/postinstall.sh $(prefix); \
|
||||||
|
fi
|
||||||
|
echo Run $(BINPREFIX)/add3proxyuser to add \'admin\' user
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
@list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var plugins/$$p; cd plugins/$$p ; make ; cd ../.. ; done
|
||||||
+3
-2
@@ -5,15 +5,16 @@
|
|||||||
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
# Add /DSAFESQL to CFLAGS if you are using poorely written/tested ODBC driver
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX = 3proxy_
|
||||||
|
CRYPT_PREFIX = 3proxy_
|
||||||
CC = cl
|
CC = cl
|
||||||
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NODEBUG" /D "NOODBC" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE)
|
CFLAGS = /nologo /Ox /MT /D "NOIPV6" /D "NO_UN" /D "NODEBUG" /D "NORADIUS" /D"WATCOM" /D "MSVC" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WIN32" /D "PRId64=\"I64d\"" /D "PRIu64=\"I64u\"" /D "SCNu64=\"I64u\"" /D "SCNx64=\"I64x\"" /D "SCNd64=\"I64d\"" /D "PRIx64=\"I64x\"" /c $(VERSION) $(BUILDDATE)
|
||||||
COUT = /Fo
|
COUT = /Fo
|
||||||
LN = link
|
LN = link
|
||||||
LDFLAGS = /nologo /subsystem:console /incremental:no
|
LDFLAGS = /nologo /subsystem:console /incremental:no
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib user32.lib kernel32.lib
|
LIBS = ws2_32.lib advapi32.lib user32.lib kernel32.lib
|
||||||
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
|
||||||
LIBSPREFIX =
|
LIBSPREFIX =
|
||||||
LIBSSUFFIX = .lib
|
LIBSSUFFIX = .lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
|
|||||||
+39
-13
@@ -2,19 +2,27 @@
|
|||||||
# 3 proxy Makefile for GCC/windows
|
# 3 proxy Makefile for GCC/windows
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# remove -DNOODBC from CFLAGS and add -lodbc to LDFLAGS to compile with ODBC
|
# ODBC support is enabled by default on Windows (-DWITH_ODBC, -lodbc32)
|
||||||
# library support
|
|
||||||
|
|
||||||
|
|
||||||
BUILDDIR = ../bin/
|
BUILDDIR = ../bin/
|
||||||
|
PREFIX ?= 3proxy_
|
||||||
|
CRYPT_PREFIX ?= $(PREFIX)
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
CFLAGS := -O2 -s -c -mthreads -DWITH_WSAPOLL $(CFLAGS)
|
CFLAGS ?= -O3 -flto
|
||||||
|
CFLAGS += -fno-strict-aliasing -c -mthreads -DWITH_WSAPOLL -DWITH_ODBC
|
||||||
COUT = -o
|
COUT = -o
|
||||||
LN ?= $(CC)
|
LN ?= $(CC)
|
||||||
LDFLAGS := -O2 -s -mthreads $(LDFLAGS)
|
LDFLAGS ?= -O3 -flto
|
||||||
|
LDFLAGS += -fno-strict-aliasing -mthreads
|
||||||
|
# Use EXTRA_CFLAGS/EXTRA_LDFLAGS to add flags from the make command line.
|
||||||
|
# Setting CFLAGS or LDFLAGS there instead overrides every assignment in this
|
||||||
|
# makefile, including the += above and the STATIC/LIBSTATIC handling below.
|
||||||
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
DLFLAGS ?= -shared
|
DLFLAGS ?= -shared
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS := -lws2_32 -lodbc32 -ladvapi32 -luser32 $(LIBS)
|
LIBS += -lws2_32 -lodbc32 -ladvapi32 -luser32 -lbcrypt
|
||||||
LIBSPREFIX = -l
|
LIBSPREFIX = -l
|
||||||
LIBSSUFFIX =
|
LIBSSUFFIX =
|
||||||
LNOUT = -o
|
LNOUT = -o
|
||||||
@@ -26,7 +34,7 @@ REMOVECOMMAND = rm -f
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.win
|
MAKEFILE = Makefile.win
|
||||||
PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin
|
PLUGINS := utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin FilePlugin
|
||||||
VERFILE := 3proxyres.o $(VERFILE)
|
VERFILE := 3proxyres.o $(VERFILE)
|
||||||
VERSION := $(VERSION)
|
VERSION := $(VERSION)
|
||||||
VERSIONDEP := 3proxyres.o $(VERSIONDEP)
|
VERSIONDEP := 3proxyres.o $(VERSIONDEP)
|
||||||
@@ -34,18 +42,36 @@ BUILDDATE := $(BUILDDATE)
|
|||||||
AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
AFTERCLEAN = (find . -type f -name "*.o" -delete && find . -type f -name "*.res" -delete && find src/ -type f -name "Makefile.var" -delete && find bin/ -type f -executable -delete) || true
|
||||||
|
|
||||||
ifndef OPENSSL_CHECK
|
ifndef OPENSSL_CHECK
|
||||||
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l crypto -l ssl -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
ifeq ($(LIBSTATIC), true)
|
||||||
ifeq ($(OPENSSL_CHECK), true)
|
STATIC_PREFIX = -Wl,-Bstatic
|
||||||
LIBS += -l crypto -l ssl
|
STATIC_SUFFIX = -Wl,-Bdynamic
|
||||||
PLUGINS += SSLPlugin
|
ZLIB = -lz
|
||||||
endif
|
endif
|
||||||
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
WOLFSSL_CHECK = $(shell echo "\#include <wolfssl/options.h>\\n\#include <wolfssl/openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) -o testwssl - 2>/dev/null && rm testwssl && echo true||echo false)
|
||||||
|
ifeq ($(WOLFSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) -lwolfssl $(STATIC_SUFFIX) -lws2_32
|
||||||
|
CFLAGS += -DWITH_SSL -DWITH_WOLFSSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
ZLIB :=
|
||||||
|
else
|
||||||
|
OPENSSL_CHECK = $(shell echo "\#include <openssl/ssl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX) -o testssl - 2>/dev/null && rm testssl && echo true||echo false)
|
||||||
|
ifeq ($(OPENSSL_CHECK), true)
|
||||||
|
LIBS += $(STATIC_PREFIX) $(ZLIB) -l crypto -l ssl $(STATIC_SUFFIX) -lcrypt32
|
||||||
|
CFLAGS += -DWITH_SSL
|
||||||
|
SSL_OBJS = ssllib$(OBJSUFFICS) ssl$(OBJSUFFICS)
|
||||||
|
else
|
||||||
|
ZLIB :=
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
PAM_CHECK = $(shell echo "\#include <security/pam_appl.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) -l pam -o testpam - 2>/dev/null && rm testpam && echo true||echo false)
|
||||||
ifeq ($(PAM_CHECK), true)
|
ifeq ($(PAM_CHECK), true)
|
||||||
PLUGINS += PamAuth
|
PLUGINS += PamAuth
|
||||||
endif
|
endif
|
||||||
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include <pcre2.h>\\n int main(){return 0;}" | tr -d '\\\\' | cc -x c $(CFLAGS) $(LDFLAGS) -lpcre2-8 -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
PCRE_CHECK = $(shell echo "\#define PCRE2_CODE_UNIT_WIDTH 8\\n#include <pcre2.h>\\n int main(){return 0;}" | tr -d '\\\\' | $(CC) -x c $(CFLAGS) $(LDFLAGS) $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX) -o testpcre - 2>/dev/null && rm testpcre && echo true||echo false)
|
||||||
ifeq ($(PCRE_CHECK), true)
|
ifeq ($(PCRE_CHECK), true)
|
||||||
PLUGINS += PCREPlugin
|
CFLAGS += -DWITH_PCRE
|
||||||
|
PCRE_OBJS = pcre$(OBJSUFFICS)
|
||||||
|
PCRE_LIBS = $(STATIC_PREFIX) -lpcre2-8 $(STATIC_SUFFIX)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,276 +0,0 @@
|
|||||||
# 3APA3A 3proxy tiny proxy server
|
|
||||||
(c) 2002-2025 by Vladimir '3APA3A' Dubrovin <3proxy@3proxy.org>
|
|
||||||
|
|
||||||
|
|
||||||
Branches:
|
|
||||||
Master (stable) branch - 3proxy 0.9
|
|
||||||
Devel branch - 3proxy 10 (don't use it)
|
|
||||||
|
|
||||||
|
|
||||||
* Download
|
|
||||||
Binaries and sources for released (master) versions (Windows, Linux):
|
|
||||||
https://github.com/z3APA3A/3proxy/releases
|
|
||||||
|
|
||||||
Docker images:
|
|
||||||
https://hub.docker.com/r/3proxy/3proxy
|
|
||||||
Archive of old versions: https://github.com/z3APA3A/3proxy-archive
|
|
||||||
|
|
||||||
* Documentation
|
|
||||||
Documentation (man pages and HTML) available with download, on https://3proxy.org/
|
|
||||||
and in github wiki https://github.com/3proxy/3proxy/wiki
|
|
||||||
|
|
||||||
* Windows installation
|
|
||||||
|
|
||||||
3proxy [path_to_config_file] --install
|
|
||||||
|
|
||||||
installs and starts proxy as Windows service
|
|
||||||
(config file should be located in the same directory or may be optionally specified)
|
|
||||||
|
|
||||||
3proxy --remove
|
|
||||||
|
|
||||||
removes the service (should be stopped before via
|
|
||||||
'net stop 3proxy').
|
|
||||||
|
|
||||||
* To build in Linux
|
|
||||||
|
|
||||||
With Makefile:
|
|
||||||
|
|
||||||
git clone https://github.com/z3apa3a/3proxy
|
|
||||||
cd 3proxy
|
|
||||||
ln -s Makefile.Linux Makefile
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
|
|
||||||
Default configuration (for Linux/Unix):
|
|
||||||
3proxy uses 2 configuration files:
|
|
||||||
/etc/3proxy/3proxy.cfg (before-chroot). This configuration file is executed before chroot and should not be modified.
|
|
||||||
/usr/local/3proxy/conf/3proxy.cfg symlinked from /etc/3proxy/conf/3proxy.cfg (after-chroot) is a main configuration file. Modify this file, if required.
|
|
||||||
All paths in /usr/local/3proxy/conf/3proxy.cfg are relative to chroot directory (/usr/local/3proxy). For future versions it's planned to move
|
|
||||||
3proxy chroot direcory to /var.
|
|
||||||
Log files are created in /usr/local/3proxy/logs symlinked from /var/log/3proxy.
|
|
||||||
By default, socks is started on 0.0.0.0:1080 and proxy on 0.0.0.0:3128 with basic auth, no users are added by default.
|
|
||||||
|
|
||||||
use /etc/3proxy/conf/add3proxyuser.sh script to add users.
|
|
||||||
|
|
||||||
usage: /etc/3proxy/conf/add3proxyuser.sh username password [day_limit] [bandwidth]
|
|
||||||
day_limit - traffic limit in MB per day
|
|
||||||
bandwidth - bandwith in bits per second 1048576 = 1Mbps
|
|
||||||
|
|
||||||
or modify /etc/3proxy/conf/ files directly.
|
|
||||||
|
|
||||||
|
|
||||||
With CMake:
|
|
||||||
|
|
||||||
git clone https://github.com/z3apa3a/3proxy
|
|
||||||
cd 3proxy
|
|
||||||
mkdir build && cd build
|
|
||||||
cmake ..
|
|
||||||
cmake --build .
|
|
||||||
sudo cmake --install .
|
|
||||||
|
|
||||||
|
|
||||||
CMake does not use chroot configuration, config file is /etc/3proxy/3proxy.cfg
|
|
||||||
|
|
||||||
* For MacOS X / FreeBSD / *BSD
|
|
||||||
|
|
||||||
With Makefile:
|
|
||||||
|
|
||||||
git clone https://github.com/z3apa3a/3proxy
|
|
||||||
cd 3proxy
|
|
||||||
ln -s Makefile.FreeBSD Makefile
|
|
||||||
make
|
|
||||||
|
|
||||||
|
|
||||||
(binaries are in bin/ directory)
|
|
||||||
|
|
||||||
With CMake (recommended):
|
|
||||||
|
|
||||||
git clone https://github.com/z3apa3a/3proxy
|
|
||||||
cd 3proxy
|
|
||||||
mkdir build && cd build
|
|
||||||
cmake ..
|
|
||||||
cmake --build .
|
|
||||||
sudo cmake --install .
|
|
||||||
|
|
||||||
|
|
||||||
This installs binaries to /usr/local/bin/, configuration to /etc/3proxy/,
|
|
||||||
plugins to /usr/local/lib/3proxy/, rc scripts to rc.d for BSD and launchd plist to /Library/LaunchDaemons/ for MacOS.
|
|
||||||
|
|
||||||
Service management on macOS:
|
|
||||||
|
|
||||||
# Load and start service
|
|
||||||
sudo launchctl load /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
|
||||||
|
|
||||||
# Stop service
|
|
||||||
sudo launchctl stop org.3proxy.3proxy
|
|
||||||
|
|
||||||
# Start service
|
|
||||||
sudo launchctl start org.3proxy.3proxy
|
|
||||||
|
|
||||||
# Unload and disable service
|
|
||||||
sudo launchctl unload /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
|
||||||
|
|
||||||
|
|
||||||
Features:
|
|
||||||
1. General
|
|
||||||
+ IPv6 support for incoming and outgoing connection,
|
|
||||||
can be used as a proxy between IPv4 and IPv6 networks
|
|
||||||
in either direction.
|
|
||||||
+ HTTP/1.1 Proxy with keep-alive client and server support,
|
|
||||||
transparent proxy support.
|
|
||||||
+ HTTPS (CONNECT) proxy (compatible with HTTP/2 / SPDY)
|
|
||||||
+ Anonymous and random client IP emulation for HTTP proxy mode
|
|
||||||
+ FTP over HTTP support.
|
|
||||||
+ DNS caching with built-in resolver
|
|
||||||
+ DNS proxy
|
|
||||||
+ DNS over TCP support, redirecting DNS traffic via parent
|
|
||||||
proxy
|
|
||||||
+ SOCKSv4/4.5 Proxy
|
|
||||||
+ SOCKSv5 Proxy
|
|
||||||
+ SOCKSv5 UDP and BIND support (fully compatible with
|
|
||||||
SocksCAP/FreeCAP for UDP)
|
|
||||||
+ Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP
|
|
||||||
+ SNI proxy (based on TLS hostname)
|
|
||||||
+ TLS (SSL) server - may be used as https:// type proxy
|
|
||||||
+ POP3 Proxy
|
|
||||||
+ FTP proxy
|
|
||||||
+ TCP port mapper (port forwarding)
|
|
||||||
+ UDP port mapper (port forwarding)
|
|
||||||
+ SMTP proxy
|
|
||||||
+ Threaded application (no child process).
|
|
||||||
+ Web administration and statistics
|
|
||||||
+ Plugins for functionality extension
|
|
||||||
+ Native 32/64 bit application
|
|
||||||
2. Proxy chaining and network connections
|
|
||||||
+ Can be used as a bridge between client and different proxy type
|
|
||||||
(e.g. convert incoming HTTP proxy request from client to SOCKSv5
|
|
||||||
request to parent server).
|
|
||||||
+ Connect back proxy support to bypass firewalls
|
|
||||||
+ Parent proxy support for any type of incoming connection
|
|
||||||
+ Username/password authentication for parent proxy(s).
|
|
||||||
+ HTTPS/SOCKS4/SOCKS5 and ip/port redirection parent support
|
|
||||||
+ Random parent selection
|
|
||||||
+ Chain building (multihop proxing)
|
|
||||||
+ Load balancing between few network connections by choosing network
|
|
||||||
interface
|
|
||||||
3. Logging
|
|
||||||
+ tuneable log format compatible with any log parser
|
|
||||||
+ stdout logging
|
|
||||||
+ file logging
|
|
||||||
+ syslog logging (Unix)
|
|
||||||
+ ODBC logging
|
|
||||||
+ RADIUS accounting
|
|
||||||
+ log file rotation
|
|
||||||
+ automatic log file processing with external archiver (for files)
|
|
||||||
+ Character filtering for log files
|
|
||||||
+ different log files for different servces are supported
|
|
||||||
4. Access control
|
|
||||||
+ ACL-driven Access control by username, source IP,
|
|
||||||
destination IP/hostname, destination port and destination action
|
|
||||||
(POST, PUT, GET, etc), weekday and daytime.
|
|
||||||
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
|
|
||||||
combined) bandwith limitation for incoming and (!)outgoing trafic.
|
|
||||||
+ ACL-driven traffic limitation per day, week or month for incoming and
|
|
||||||
outgoing traffic
|
|
||||||
+ Connection limitation and ratelimting
|
|
||||||
+ User authentication by username / password
|
|
||||||
+ RADIUS Authentication and Authorization
|
|
||||||
+ User authentication by DNS hostname
|
|
||||||
+ Authentication cache with possibility to limit user to single IP address
|
|
||||||
+ Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
|
||||||
+ Cleartext or encrypted (crypt/MD5 or NT) passwords.
|
|
||||||
+ Connection redirection
|
|
||||||
+ Access control by requested action (CONNECT/BIND,
|
|
||||||
HTTP GET/POST/PUT/HEAD/OTHER).
|
|
||||||
+ All access control entries now support weekday and time limitations
|
|
||||||
+ Hostnames and * templates are supported instead of IP address
|
|
||||||
5. Extensions
|
|
||||||
+ Regular expression filtering (with PCRE2) via PCREPlugin
|
|
||||||
+ Authentication with Windows username/password (cleartext only)
|
|
||||||
+ SSL/TLS decryptions with certificate spoofing
|
|
||||||
+ Transparent redirection support for Linux and *BSD
|
|
||||||
6. Configuration
|
|
||||||
+ support for configuration files
|
|
||||||
+ support for includes in configuration files
|
|
||||||
+ interface binding
|
|
||||||
+ socket options
|
|
||||||
+ running as daemon process
|
|
||||||
+ utility for automated networks list building
|
|
||||||
+ configuration reload on any file change
|
|
||||||
Unix
|
|
||||||
+ support for chroot
|
|
||||||
+ support for setgid
|
|
||||||
+ support for setuid
|
|
||||||
+ support for signals (SIGUSR1 to reload configuration)
|
|
||||||
Windows
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
+ support for service START, STOP, PAUSE and CONTINUE commands (on
|
|
||||||
PAUSE no new connection accepted, but active connections still in
|
|
||||||
progress, on CONTINUE configuration is reloaded)
|
|
||||||
Windows 95/98/ME
|
|
||||||
+ support --install as service
|
|
||||||
+ support --remove as service
|
|
||||||
6. Compilation
|
|
||||||
+ MSVC (static)
|
|
||||||
+ OpenWatcom (static)
|
|
||||||
+ Intel Windows Compiler (msvcrt.dll)
|
|
||||||
+ Windows/gcc (msvcrt.dll)
|
|
||||||
+ Cygwin/gcc (cygwin.dll)
|
|
||||||
+ Unix/gcc
|
|
||||||
+ Unix/ccc
|
|
||||||
+ Solaris
|
|
||||||
+ Mac OS X, iPhone OS
|
|
||||||
+ Linux and derivered systems
|
|
||||||
+ Lite version for Windows 95/98/NT/2000/XP/2003
|
|
||||||
+ 32 bit and 64 bit versions for Windows Vista and above, Windows 2008 server and above
|
|
||||||
|
|
||||||
3proxy Combined proxy server may be used as
|
|
||||||
executable or service (supports installation and removal).
|
|
||||||
It uses config file to read it's configuration (see
|
|
||||||
3proxy.cfg.sample for details).
|
|
||||||
3proxy.exe is all-in-one, it doesn't require all others .exe
|
|
||||||
to work.
|
|
||||||
See 3proxy.cfg.sample for examples, see man 3proxy.cfg
|
|
||||||
|
|
||||||
proxy HTTP proxy server, binds to port 3128
|
|
||||||
ftppr FTP proxy server, binds to port 21
|
|
||||||
socks SOCKS 4/5 proxy server, binds to port 1080
|
|
||||||
ftppr FTP proxy server, please do not mess it with FTP over HTTP
|
|
||||||
proxy used in browsers
|
|
||||||
pop3p POP3 proxy server, binds to port 110. You must specify
|
|
||||||
POP3 username as username@target.host.ip[:port]
|
|
||||||
port is 110 by default.
|
|
||||||
Exmple: in Username configuration for you e-mail reader
|
|
||||||
set someuser@pop.example.org, to obtains mail for someuser
|
|
||||||
from pop.somehost.ru via proxy.
|
|
||||||
smtpp SMTP proxy server, binds to port 25. You must specify
|
|
||||||
SMTP username as username@target.host.ip[:port]
|
|
||||||
port is 25 by default.
|
|
||||||
Exmple: in Username configuration for you e-mail reader
|
|
||||||
set someuser@mail.example.org, to send mail as someuser
|
|
||||||
via mail.somehost.ru via proxy.
|
|
||||||
tcppm TCP port mapping. Maps some TCP port on local machine to
|
|
||||||
TCP port on remote host.
|
|
||||||
tlspr TLS proxy (SNI proxy) - sniffs hostname from TLS handshake
|
|
||||||
udppm UDP port mapping. Maps some UDP port on local machine to
|
|
||||||
UDP port on remote machine. Only one user simulationeously
|
|
||||||
can use UDP mapping, so it cann't be used for public service
|
|
||||||
in large networks. It's OK to use it to map to DNS server
|
|
||||||
in small network or to map Counter-Strike server for single
|
|
||||||
client (you can use few mappings on different ports for
|
|
||||||
different clients in last case).
|
|
||||||
mycrypt Program to obtain crypted password fro cleartext. Supports
|
|
||||||
both MD5/crypt and NT password.
|
|
||||||
mycrypt password
|
|
||||||
produces NT password
|
|
||||||
mycrypt salt password
|
|
||||||
produces MD5/crypt password with salt "salt".
|
|
||||||
|
|
||||||
|
|
||||||
Run utility with --help option for command line reference.
|
|
||||||
|
|
||||||
Latest version is available from https://3proxy.org/
|
|
||||||
|
|
||||||
Want to donate the project? https://3proxy.org/donations/
|
|
||||||
@@ -0,0 +1,379 @@
|
|||||||
|
# 3APA3A 3proxy tiny proxy server
|
||||||
|
|
||||||
|
(c) 2002-2026 by Vladimir '3APA3A' Dubrovin <vlad@3proxy.org>
|
||||||
|
|
||||||
|
## Repository
|
||||||
|
|
||||||
|
### Branches
|
||||||
|
|
||||||
|
- **Master** (stable) branch - 3proxy 0.9
|
||||||
|
- **Devel** branch - 3proxy 10 (don't use it)
|
||||||
|
|
||||||
|
### Binaries (deb / rpm / Windows zip)
|
||||||
|
|
||||||
|
https://github.com/3proxy/3proxy/releases
|
||||||
|
|
||||||
|
### Docker images
|
||||||
|
|
||||||
|
https://hub.docker.com/r/3proxy/3proxy
|
||||||
|
https://github.com/3proxy/3proxy/pkgs/container/3proxy
|
||||||
|
|
||||||
|
### Archive of old versions
|
||||||
|
|
||||||
|
https://github.com/z3APA3A/3proxy-archive
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
Documentation (man pages and HTML) available with download, on https://3proxy.org/ and in github wiki https://github.com/3proxy/3proxy/wiki
|
||||||
|
|
||||||
|
## 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.
|
||||||
|
|
||||||
|
### Default image (`:latest`):
|
||||||
|
|
||||||
|
Full installation requires to mount /etc/3proxy/3proxy.cfg files.
|
||||||
|
|
||||||
|
For docker, config can be provided via `docker config`
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "log
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65536
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
`podman` does not support `config` as above.
|
||||||
|
Mounts may be used as config alternative. `podman` used in example below can be replaced with `docker`:
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "log
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65536
|
||||||
|
proxy -p3129" >/path/to/local/config/directory/3proxy.cfg
|
||||||
|
podman run --read-only -p 3129:3129 -v /path/to/local/config/directory/3proxy.cfg:/etc/3proxy/3proxy.cfg --name 3proxy.full 3proxy.full
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Busybox image (`: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.
|
||||||
|
|
||||||
|
### Interactive `:minimal` image:
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
`plugin` is not supported, `nserver` or `fakeresolve` are mandatory, because system resolver is not supported, no support for RADIUS and IPv6.
|
||||||
|
|
||||||
|
Run example:
|
||||||
|
|
||||||
|
`docker run --read-only -i -p 3129:3129 --name 3proxy docker.io/3proxy/3proxy:minimal`
|
||||||
|
or
|
||||||
|
`docker start -ai 3proxy` to start existing container
|
||||||
|
|
||||||
|
send this to standard input (example):
|
||||||
|
```
|
||||||
|
nserver 8.8.8.8
|
||||||
|
nscache 65535
|
||||||
|
log
|
||||||
|
proxy -p3129
|
||||||
|
end
|
||||||
|
```
|
||||||
|
`nserver` is required for DNS resolutions.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Building and installation
|
||||||
|
|
||||||
|
### Windows Installation
|
||||||
|
|
||||||
|
Install and start proxy as Windows service:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy [path_to_config_file] --install
|
||||||
|
```
|
||||||
|
|
||||||
|
Config file should be located in the same directory or may be optionally specified.
|
||||||
|
|
||||||
|
Remove the service (should be stopped before via `net stop 3proxy`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy --remove
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building and installation on Linux
|
||||||
|
|
||||||
|
#### With Makefile
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
ln -s Makefile.Linux Makefile
|
||||||
|
make
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Default Configuration (for Makefile.Linux installation)
|
||||||
|
|
||||||
|
3proxy uses 2 configuration files in :
|
||||||
|
- `/etc/3proxy/3proxy.cfg` (before-chroot) - This configuration file is executed before chroot and should not be modified.
|
||||||
|
- `/usr/local/3proxy/conf/3proxy.cfg` symlinked from `/etc/3proxy/conf/3proxy.cfg` (after-chroot) - Main configuration file. Modify this file if required.
|
||||||
|
|
||||||
|
All paths in `/usr/local/3proxy/conf/3proxy.cfg` are relative to chroot directory (`/usr/local/3proxy`). For future versions it's planned to move 3proxy chroot directory to `/var`.
|
||||||
|
|
||||||
|
Log files are created in `/usr/local/3proxy/logs` symlinked from `/var/log/3proxy`.
|
||||||
|
|
||||||
|
By default, socks is started on 0.0.0.0:1080 and proxy on 0.0.0.0:3128 with basic auth, no users are added by default.
|
||||||
|
|
||||||
|
#### Adding Users
|
||||||
|
|
||||||
|
Use `add3proxyuser` script to add users:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
add3proxyuser username password [day_limit] [bandwidth]
|
||||||
|
```
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- `day_limit` - traffic limit in MB per day
|
||||||
|
- `bandwidth` - bandwidth in bits per second (1048576 = 1Mbps)
|
||||||
|
|
||||||
|
Or modify `/etc/3proxy/conf/` files directly.
|
||||||
|
|
||||||
|
#### With CMake
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
sudo cmake --install .
|
||||||
|
```
|
||||||
|
|
||||||
|
CMake does not use chroot configuration, config file is `/etc/3proxy/3proxy.cfg`
|
||||||
|
|
||||||
|
### MacOS X / FreeBSD / *BSD
|
||||||
|
|
||||||
|
#### With Makefile
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
ln -s Makefile.FreeBSD Makefile
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
Binaries are in `bin/` directory.
|
||||||
|
|
||||||
|
#### With CMake (recommended)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/z3apa3a/3proxy
|
||||||
|
cd 3proxy
|
||||||
|
mkdir build && cd build
|
||||||
|
cmake ..
|
||||||
|
cmake --build .
|
||||||
|
sudo cmake --install .
|
||||||
|
```
|
||||||
|
|
||||||
|
This installs:
|
||||||
|
- Binaries to `/usr/local/bin/`
|
||||||
|
- Configuration to `/etc/3proxy/`
|
||||||
|
- Plugins to `/usr/local/lib/3proxy/`
|
||||||
|
- rc scripts to `rc.d` for BSD
|
||||||
|
- launchd plist to `/Library/LaunchDaemons/` for MacOS
|
||||||
|
|
||||||
|
#### Service Management on macOS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Load and start service
|
||||||
|
sudo launchctl load /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
||||||
|
|
||||||
|
# Stop service
|
||||||
|
sudo launchctl stop org.3proxy.3proxy
|
||||||
|
|
||||||
|
# Start service
|
||||||
|
sudo launchctl start org.3proxy.3proxy
|
||||||
|
|
||||||
|
# Unload and disable service
|
||||||
|
sudo launchctl unload /Library/LaunchDaemons/org.3proxy.3proxy.plist
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
### 1. General
|
||||||
|
|
||||||
|
- IPv4 / IPv6 support for incoming and outgoing connection, can be used as a proxy between IPv4 and IPv6 networks in either direction
|
||||||
|
- Unix domain sockets support
|
||||||
|
- HTTP/1.1 Proxy with keep-alive client and server support, transparent proxy support
|
||||||
|
- HTTPS (CONNECT) proxy (compatible with HTTP/2 / SPDY)
|
||||||
|
- Anonymous and random client IP emulation for HTTP proxy mode
|
||||||
|
- FTP over HTTP support
|
||||||
|
- DNS caching with built-in resolver
|
||||||
|
- DNS proxy
|
||||||
|
- DNS over TCP support, redirecting DNS traffic via parent proxy
|
||||||
|
- SOCKSv4/4.5 Proxy
|
||||||
|
- SOCKSv5 Proxy
|
||||||
|
- SOCKSv5 UDP and BIND support (fully compatible with SocksCAP/FreeCAP for UDP)
|
||||||
|
- Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP
|
||||||
|
- SNI proxy (based on TLS hostname)
|
||||||
|
- TLS (SSL) server and client, 3proxy may be used as https:// type proxy or stunnel replacement
|
||||||
|
- POP3 Proxy
|
||||||
|
- FTP proxy
|
||||||
|
- TCP port mapper (port forwarding)
|
||||||
|
- UDP port mapper (port forwarding)
|
||||||
|
- SMTP proxy
|
||||||
|
- Threaded application (no child process)
|
||||||
|
- Web administration and statistics
|
||||||
|
- Plugins for functionality extension
|
||||||
|
- Native 32/64 bit application
|
||||||
|
|
||||||
|
### 2. Proxy Chaining and Network Connections
|
||||||
|
|
||||||
|
- Can be used as a bridge between client and different proxy type (e.g. convert incoming HTTP proxy request from client to SOCKSv5 request to parent server)
|
||||||
|
- Connect back proxy support to bypass firewalls
|
||||||
|
- Parent proxy support for any type of incoming connection
|
||||||
|
- Username/password authentication for parent proxy(s)
|
||||||
|
- HTTPS/SOCKS4/SOCKS5 and ip/port redirection parent support
|
||||||
|
- Random parent selection
|
||||||
|
- Chain building (multihop proxing)
|
||||||
|
- Load balancing between few network connections by choosing network interface
|
||||||
|
|
||||||
|
### 3. Logging
|
||||||
|
|
||||||
|
- Tuneable log format compatible with any log parser
|
||||||
|
- stdout logging
|
||||||
|
- File logging
|
||||||
|
- Syslog logging (Unix)
|
||||||
|
- ODBC logging
|
||||||
|
- RADIUS accounting
|
||||||
|
- Log file rotation
|
||||||
|
- Automatic log file processing with external archiver (for files)
|
||||||
|
- Character filtering for log files
|
||||||
|
- Different log files for different services are supported
|
||||||
|
|
||||||
|
### 4. Access Control
|
||||||
|
|
||||||
|
- ACL-driven Access control by username, source IP, destination IP/hostname, destination port and destination action (POST, PUT, GET, etc), weekday and daytime
|
||||||
|
- ACL-driven (user/source/destination/protocol/weekday/daytime or combined) bandwidth limitation for incoming and (!)outgoing traffic
|
||||||
|
- ACL-driven traffic limitation per day, week or month for incoming and outgoing traffic
|
||||||
|
- Connection limitation and ratelimiting
|
||||||
|
- User authentication by username / password
|
||||||
|
- RADIUS Authentication and Authorization
|
||||||
|
- User authentication by DNS hostname
|
||||||
|
- Authentication cache with possibility to limit user to single IP address
|
||||||
|
- Access control by username/password for SOCKSv5 and HTTP/HTTPS/FTP
|
||||||
|
- Cleartext or encrypted passwords
|
||||||
|
- Connection redirection
|
||||||
|
- Access control by requested action (CONNECT/BIND, HTTP GET/POST/PUT/HEAD/OTHER)
|
||||||
|
- All access control entries now support weekday and time limitations
|
||||||
|
- Hostnames and * templates are supported instead of IP address
|
||||||
|
|
||||||
|
### 5. Extensions
|
||||||
|
|
||||||
|
- Regular expression filtering (with PCRE2) via PCREPlugin
|
||||||
|
- Authentication with Windows username/password (cleartext only)
|
||||||
|
- SSL/TLS decryptions with certificate spoofing
|
||||||
|
- Transparent redirection support for Linux and *BSD
|
||||||
|
|
||||||
|
### 6. Configuration
|
||||||
|
|
||||||
|
- Support for configuration files
|
||||||
|
- Support for includes in configuration files
|
||||||
|
- Interface binding
|
||||||
|
- Socket options
|
||||||
|
- Running as daemon process
|
||||||
|
- Utility for automated networks list building
|
||||||
|
- Configuration reload on any file change
|
||||||
|
|
||||||
|
**Unix:**
|
||||||
|
- Support for chroot
|
||||||
|
- Support for setgid
|
||||||
|
- Support for setuid
|
||||||
|
- Support for signals (SIGUSR1 to reload configuration)
|
||||||
|
|
||||||
|
**Windows:**
|
||||||
|
- Support `--install` as service
|
||||||
|
- Support `--remove` as service
|
||||||
|
- Support for service START, STOP, PAUSE and CONTINUE commands (on PAUSE no new connection accepted, but active connections still in progress, on CONTINUE configuration is reloaded)
|
||||||
|
|
||||||
|
**Windows 95/98/ME:**
|
||||||
|
- Support `--install` as service
|
||||||
|
- Support `--remove` as service
|
||||||
|
|
||||||
|
### 7. Compilation
|
||||||
|
|
||||||
|
- MSVC (static)
|
||||||
|
- OpenWatcom (static)
|
||||||
|
- Intel Windows Compiler (msvcrt.dll)
|
||||||
|
- Windows/gcc (msvcrt.dll)
|
||||||
|
- Cygwin/gcc (cygwin.dll)
|
||||||
|
- Unix/gcc
|
||||||
|
- Unix/ccc
|
||||||
|
- Solaris
|
||||||
|
- Mac OS X, iPhone OS
|
||||||
|
- Linux and derived systems
|
||||||
|
- Lite version for Windows 95/98/NT/2000/XP/2003
|
||||||
|
- 32 bit and 64 bit versions for Windows Vista and above, Windows 2008 server and above
|
||||||
|
|
||||||
|
## Executables
|
||||||
|
|
||||||
|
### 3proxy
|
||||||
|
Combined proxy server may be used as executable or service (supports installation and removal). It uses config file to read its configuration (see `3proxy.cfg.sample` for details). `3proxy.exe` is all-in-one, it doesn't require all others .exe to work. See `3proxy.cfg.sample` for examples, see `man 3proxy.cfg`
|
||||||
|
|
||||||
|
### 3proxy_proxy
|
||||||
|
HTTP proxy server, binds to port 3128
|
||||||
|
|
||||||
|
### 3proxy_ftppr
|
||||||
|
FTP proxy server, binds to port 21. Please do not mess it with FTP over HTTP proxy used in browsers
|
||||||
|
|
||||||
|
### 3proxy_socks
|
||||||
|
SOCKS 4/5 proxy server, binds to port 1080
|
||||||
|
|
||||||
|
### 3proxy_pop3p
|
||||||
|
POP3 proxy server, binds to port 110. You must specify POP3 username as `username@popserver[:port]` (port is 110 by default).
|
||||||
|
|
||||||
|
Example: in Username configuration for your e-mail reader set `someuser@pop.somehost.ru`, to obtain mail for someuser from pop.somehost.ru via proxy.
|
||||||
|
|
||||||
|
### 3proxy_smtpp
|
||||||
|
SMTP proxy server, binds to port 25. You must specify SMTP username as `username@smtpserver[:port]` (port is 25 by default).
|
||||||
|
|
||||||
|
Example: in Username configuration for your e-mail reader set `someuser@mail.somehost.ru`, to send mail as someuser via mail.somehost.ru via proxy.
|
||||||
|
|
||||||
|
### 3proxy_tcppm
|
||||||
|
TCP port mapping. Maps some TCP port on local machine to TCP port on remote host.
|
||||||
|
|
||||||
|
### 3proxy_tlspr
|
||||||
|
TLS proxy (SNI proxy) - sniffs hostname from TLS handshake
|
||||||
|
|
||||||
|
### 3proxy_udppm
|
||||||
|
UDP port mapping. Maps some UDP port on local machine to UDP port on remote machine. Only one user simultaneously can use UDP mapping, so it can't be used for public service in large networks. It's OK to use it to map to DNS server in small network or to map Counter-Strike server for single client (you can use few mappings on different ports for different clients in last case).
|
||||||
|
|
||||||
|
### 3proxy_crypt
|
||||||
|
Program to obtain crypted password for cleartext. Supports both salted and NT password.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
3proxy_crypt password # produces NT password
|
||||||
|
3proxy_crypt salt password # produces password hash with salt "salt"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Run utility with `--help` option for command line reference.
|
||||||
|
|
||||||
|
Latest version is available from https://3proxy.org/
|
||||||
|
|
||||||
|
Want to donate the project? https://3proxy.org/donations/
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 0.9.8 | :white_check_mark: |
|
||||||
|
| < 0.9.8 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Report to 3proxy@3proxy.org or via [GitHub security reporting](https://github.com/3proxy/3proxy/security)
|
||||||
|
|
||||||
|
For High/Critical patched version is released within 2 weeks
|
||||||
+12
-12
@@ -2,7 +2,7 @@
|
|||||||
# Yes, 3proxy.cfg can be executable, in this case you should place
|
# Yes, 3proxy.cfg can be executable, in this case you should place
|
||||||
# something like
|
# something like
|
||||||
#config /usr/local/3proxy/3proxy.cfg
|
#config /usr/local/3proxy/3proxy.cfg
|
||||||
# to show which configuration 3proxy should re-read on realod.
|
# to show which configuration 3proxy should re-read on reload.
|
||||||
|
|
||||||
#system "echo Hello world!"
|
#system "echo Hello world!"
|
||||||
# you may use system to execute some external command if proxy starts
|
# you may use system to execute some external command if proxy starts
|
||||||
@@ -24,7 +24,7 @@ timeouts 1 5 30 60 180 1800 15 60
|
|||||||
# Here we can change timeout values
|
# Here we can change timeout values
|
||||||
|
|
||||||
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
|
||||||
# note that "" required, overvise $... is treated as include file name.
|
# note that "" required, otherwise $... is treated as include file name.
|
||||||
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
# $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
|
||||||
#users $/usr/local/etc/3proxy/passwd
|
#users $/usr/local/etc/3proxy/passwd
|
||||||
# this example shows you how to include passwd file. For included files
|
# this example shows you how to include passwd file. For included files
|
||||||
@@ -39,7 +39,7 @@ service
|
|||||||
|
|
||||||
#log /var/log/3proxy/log D
|
#log /var/log/3proxy/log D
|
||||||
log c:\3proxy\logs\3proxy.log D
|
log c:\3proxy\logs\3proxy.log D
|
||||||
# log allows to specify log file location and rotation, D means logfile
|
# log allows you to specify log file location and rotation, D means logfile
|
||||||
# is created daily
|
# is created daily
|
||||||
|
|
||||||
#logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
#logformat "L%d-%m-%Y %H:%M:%S %z %N.%p %E %U %C:%c %R:%r %O %I %h %T"
|
||||||
@@ -60,7 +60,7 @@ log c:\3proxy\logs\3proxy.log D
|
|||||||
#
|
#
|
||||||
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
#Compatible with ISA 2000/2004 firewall FWSEXTD.log (fields are TAB-delimited):
|
||||||
#
|
#
|
||||||
#"- + L%C %U unnknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
#"- + L%C %U unknown:0:0.0 N %Y-%m-%d %H:%M:%S fwsrv 3PROXY - %n %R %r %D %O %I %r TCP Connect - - - %E - - - - -"
|
||||||
#
|
#
|
||||||
#Compatible with HTTPD standard log (Apache and others)
|
#Compatible with HTTPD standard log (Apache and others)
|
||||||
#
|
#
|
||||||
@@ -90,7 +90,7 @@ auth iponly
|
|||||||
# auth specifies type of user authentication. If you specify none proxy
|
# auth specifies type of user authentication. If you specify none proxy
|
||||||
# will not do anything to check name of the user. If you specify
|
# will not do anything to check name of the user. If you specify
|
||||||
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
# nbname proxy will send NetBIOS name request packet to UDP/137 of
|
||||||
# client and parse request for NetBIOS name of messanger service.
|
# client and parse request for NetBIOS name of messenger service.
|
||||||
# Strong means that proxy will check password. For strong authentication
|
# Strong means that proxy will check password. For strong authentication
|
||||||
# unknown user will not be allowed to use proxy regardless of ACL.
|
# unknown user will not be allowed to use proxy regardless of ACL.
|
||||||
# If you do not want username to be checked but wanna ACL to work you should
|
# If you do not want username to be checked but wanna ACL to work you should
|
||||||
@@ -102,7 +102,7 @@ auth iponly
|
|||||||
#parent 1000 http 192.168.1.2 80 * * * 80
|
#parent 1000 http 192.168.1.2 80 * * * 80
|
||||||
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
#allow * 192.168.1.0/24 * 25,53,110,20-21,1024-65535
|
||||||
# we will allow everything if username matches ADMINISTRATOR or root or
|
# we will allow everything if username matches ADMINISTRATOR or root or
|
||||||
# client ip is 127.0.0.1 or 192.168.1.1. Overwise we will redirect any request
|
# client ip is 127.0.0.1 or 192.168.1.1. Otherwise we will redirect any request
|
||||||
# to port 80 to our Web-server 192.168.0.2.
|
# to port 80 to our Web-server 192.168.0.2.
|
||||||
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
# We will allow any outgoing connections from network 192.168.1.0/24 to
|
||||||
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
# SMTP, POP3, FTP, DNS and unprivileged ports.
|
||||||
@@ -124,7 +124,7 @@ internal 192.168.1.1
|
|||||||
# have open proxy in your network in this case.
|
# have open proxy in your network in this case.
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
# no authentication is requires
|
# no authentication is required
|
||||||
|
|
||||||
dnspr
|
dnspr
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ dnspr
|
|||||||
|
|
||||||
#external $./external.ip
|
#external $./external.ip
|
||||||
#internal $./internal.ip
|
#internal $./internal.ip
|
||||||
# this is just an alternative form fo giving external and internal address
|
# this is just an alternative form for giving external and internal address
|
||||||
# allows you to read this addresses from files
|
# allows you to read this addresses from files
|
||||||
|
|
||||||
auth none
|
auth none
|
||||||
@@ -149,7 +149,7 @@ tcppm 25 mail.my.provider 25
|
|||||||
# Now we can use our proxy as SMTP and DNS server.
|
# Now we can use our proxy as SMTP and DNS server.
|
||||||
# -s switch for UDP means "single packet" service - instead of setting
|
# -s switch for UDP means "single packet" service - instead of setting
|
||||||
# association for period of time association will only be set for 1 packet.
|
# association for period of time association will only be set for 1 packet.
|
||||||
# It's very userfull for services like DNS but not for some massive services
|
# It's very useful for services like DNS but not for some massive services
|
||||||
# like multimedia streams or online games.
|
# like multimedia streams or online games.
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
@@ -158,7 +158,7 @@ internal 127.0.0.1
|
|||||||
allow 3APA3A 127.0.0.1
|
allow 3APA3A 127.0.0.1
|
||||||
maxconn 3
|
maxconn 3
|
||||||
admin
|
admin
|
||||||
#only allow acces to admin interface for user 3APA3A from 127.0.0.1 address
|
#only allow access to admin interface for user 3APA3A from 127.0.0.1 address
|
||||||
#via 127.0.0.1 address.
|
#via 127.0.0.1 address.
|
||||||
|
|
||||||
# map external 80 and 443 ports to internal Web server
|
# map external 80 and 443 ports to internal Web server
|
||||||
@@ -178,14 +178,14 @@ admin
|
|||||||
#chroot /usr/local/jail
|
#chroot /usr/local/jail
|
||||||
#setgid 65535
|
#setgid 65535
|
||||||
#setuid 65535
|
#setuid 65535
|
||||||
# now we needn't any root rights. We can chroot and setgid/setuid.
|
# now we no longer need root rights. We can chroot and setgid/setuid.
|
||||||
|
|
||||||
|
|
||||||
auth strong
|
auth strong
|
||||||
flush
|
flush
|
||||||
# We want to protect internal interface
|
# We want to protect internal interface
|
||||||
deny * * 127.0.0.1,192.168.1.1
|
deny * * 127.0.0.1,192.168.1.1
|
||||||
# and llow HTTP and HTTPS traffic.
|
# and allow HTTP and HTTPS traffic.
|
||||||
allow * * * 80-88,8080-8088 HTTP
|
allow * * * 80-88,8080-8088 HTTP
|
||||||
allow * * * 443,8443 HTTPS
|
allow * * * 443,8443 HTTPS
|
||||||
proxy -n
|
proxy -n
|
||||||
|
|||||||
Vendored
-10
@@ -1,10 +0,0 @@
|
|||||||
man/3proxy.8
|
|
||||||
man/3proxy.cfg.3
|
|
||||||
man/ftppr.8
|
|
||||||
man/pop3p.8
|
|
||||||
man/tlspr.8
|
|
||||||
man/proxy.8
|
|
||||||
man/smtpp.8
|
|
||||||
man/socks.8
|
|
||||||
man/tcppm.8
|
|
||||||
man/udppm.8
|
|
||||||
Vendored
+18
@@ -1,3 +1,21 @@
|
|||||||
|
3proxy (0.9.9-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.9 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Thu, 20 Aug 2026 18:29:37 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.8-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.8 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Fri, 07 Aug 2026 17:44:30 +0300
|
||||||
|
|
||||||
|
3proxy (0.9.7-1) buster; urgency=medium
|
||||||
|
|
||||||
|
*3proxy 0.9.7 initial build
|
||||||
|
|
||||||
|
-- z3APA3A <3apa3a@3proxy.org> Sat, 04 Jul 2026 11:55:03 +0300
|
||||||
|
|
||||||
3proxy (0.9.6-1) buster; urgency=medium
|
3proxy (0.9.6-1) buster; urgency=medium
|
||||||
|
|
||||||
*3proxy 0.9.6 initial build
|
*3proxy 0.9.6 initial build
|
||||||
|
|||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
/etc/3proxy/3proxy.cfg
|
||||||
|
/usr/local/3proxy/conf/3proxy.cfg
|
||||||
|
/usr/local/3proxy/conf/bandlimiters
|
||||||
|
/usr/local/3proxy/conf/counters
|
||||||
Vendored
+4
-11
@@ -4,17 +4,10 @@ Upstream-Contact: 3proxy@3proxy.org
|
|||||||
Source: https://3proxy.org/
|
Source: https://3proxy.org/
|
||||||
|
|
||||||
Files: *
|
Files: *
|
||||||
Copyright: 2000-2020 3APA3A, Vladimir Dubrovin, 3proxy.org
|
Copyright: 2000-2026 Vladimir Dubrovin <vlad@3proxy.org>
|
||||||
License: BSD-3-clause or Apache or GPL-2+ or LGPL-2+
|
License: BSD-3-clause or Apache or GPL-2+ or LGPL-2+
|
||||||
|
|
||||||
Files: src/libs/md*.*
|
Files: src/libs/blake2*.*
|
||||||
Copyright: 1990,1991,1992 RSA Data Security, Inc
|
Copyright: 2012, Samuel Neves <sneves@dei.uc.pt>
|
||||||
License: public-domain
|
License: public-domain (CC0 1.0 Universal) or OpenSSL license or Apache 2.0
|
||||||
|
|
||||||
Files: src/libs/regex.*
|
|
||||||
Copyright: Henry Spencer
|
|
||||||
License: public-domain
|
|
||||||
|
|
||||||
Files: src/libs/smbdes.c
|
|
||||||
Copyright: Andrew Tridgell 1998
|
|
||||||
License: GPL-2+
|
|
||||||
Vendored
+14
@@ -1,3 +1,17 @@
|
|||||||
|
[ -f /bin/add3proxyuser ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@3PROXY_CONFDIR@|/etc/3proxy/conf|g' -e 's|@CRYPT_PREFIX@|3proxy_|g' /bin/add3proxyuser; \
|
||||||
|
[ -f /etc/init.d/3proxy ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' -e 's|USER=proxy|USER=root|g' /etc/init.d/3proxy; \
|
||||||
|
[ -f /usr/lib/systemd/system/3proxy.service ] && sed -i -e 's|@CMAKE_INSTALL_FULL_BINDIR@|/bin|g' -e 's|@CMAKE_INSTALL_FULL_SYSCONFDIR@|/etc|g' -e 's|User=proxy|User=root|g' /usr/lib/systemd/system/3proxy.service; \
|
||||||
|
|
||||||
|
if [ -d /etc/3proxy ]; then \
|
||||||
|
chmod -R o-rwx /etc/3proxy; \
|
||||||
|
chown -R proxy:proxy /etc/3proxy; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/local/3proxy ]; then \
|
||||||
|
chmod -R o-rwx /usr/local/3proxy; \
|
||||||
|
chown -R proxy:proxy /usr/local/3proxy; \
|
||||||
|
fi
|
||||||
|
|
||||||
if /bin/systemctl >/dev/null 2>&1; then \
|
if /bin/systemctl >/dev/null 2>&1; then \
|
||||||
/usr/sbin/update-rc.d 3proxy disable || true; \
|
/usr/sbin/update-rc.d 3proxy disable || true; \
|
||||||
/usr/sbin/chkconfig 3proxy off || true; \
|
/usr/sbin/chkconfig 3proxy off || true; \
|
||||||
|
|||||||
Vendored
+14
-1
@@ -3,8 +3,21 @@
|
|||||||
%:
|
%:
|
||||||
dh $@
|
dh $@
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
ln -sf Makefile.Linux Makefile
|
||||||
|
|
||||||
|
override_dh_auto_build:
|
||||||
|
$(MAKE)
|
||||||
|
|
||||||
|
override_dh_auto_install:
|
||||||
|
$(MAKE) DESTDIR=debian/3proxy install
|
||||||
|
|
||||||
|
override_dh_installman:
|
||||||
|
|
||||||
|
override_dh_usrlocal:
|
||||||
|
|
||||||
override_dh_auto_clean:
|
override_dh_auto_clean:
|
||||||
find src/ -type f -name "*.o" -delete
|
find src/ -type f -name "*.o" -delete
|
||||||
find src/ -type f -name "Makefile.var" -delete
|
find src/ -type f -name "Makefile.var" -delete
|
||||||
find bin/ -type f -executable -delete
|
find bin/ -type f -executable -delete
|
||||||
|
rm -f Makefile
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
3proxy 0.7
|
||||||
|
|
||||||
|
This release is partially forced: while no new significant functions are
|
||||||
|
added, 0.7 is code is much more stable and less buggy than 0.6. Since
|
||||||
|
there is no new development for a long time, except few minor bugfixes,
|
||||||
|
I decided to finally release 0.7. You may want it if you:
|
||||||
|
|
||||||
|
Use HTTP proxy
|
||||||
|
Use 3proxy under *BSD/Mac OS X/iPhone OS
|
||||||
|
Use plugins, specially traffic related ones, like PCRE.
|
||||||
|
|
||||||
|
I have no time for active developement. There are interesting features
|
||||||
|
in nearly ready state, e.g. SSL support / SSL decryption via
|
||||||
|
certificates spoofing, NAT support and SSL auto-detection. You can step
|
||||||
|
into development, if you are interested.
|
||||||
|
|
||||||
|
There are some configuration changes:
|
||||||
|
|
||||||
|
auth iponly is now default (because most misconfigurations were
|
||||||
|
because of default auth none)
|
||||||
|
maxconn is now 500 by default (because WebKit browsers ignore
|
||||||
|
standards and create a lot of connections even if proxy is configured)
|
||||||
|
NTLM is disabled by default (-n options, -n1 to enable) because
|
||||||
|
NTLMv1 is disabled by default in Windows since Vista and there is no
|
||||||
|
NTLMv2 library with compatible license. Report me, if any.
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
3proxy-0.7.1.4
|
||||||
|
|
||||||
|
!! Fix transparent flag not reset after keep-alive connection, can lead to
|
||||||
|
|
||||||
|
|
||||||
|
3proxy-0.7.1.3
|
||||||
|
|
||||||
|
! traffic displayed incorrectly
|
||||||
|
! archiver doesn't add suffix if logname contains macro
|
||||||
|
! fix potential race condition on configuration reload
|
||||||
|
! fix FTP over HTTP authentication
|
||||||
|
|
||||||
|
|
||||||
|
3proxy-0.7.1.2
|
||||||
|
|
||||||
|
! Request / header size limitation relaxed for HTTP proxy
|
||||||
|
|
||||||
|
|
||||||
|
3proxy 0.7.1.1
|
||||||
|
|
||||||
|
! Linux compilation issues resolved
|
||||||
|
|
||||||
|
|
||||||
|
3proxy 0.7.1
|
||||||
|
|
||||||
|
Minor improvements and bugfixes:
|
||||||
|
|
||||||
|
+ Windows icons added
|
||||||
|
+ Warnings added for most common misconfigurations
|
||||||
|
+ ftppr NLSD command supported
|
||||||
|
! Ignore NTLM handshake if NTLM is not enabled
|
||||||
|
!! memcpy replaced with memmove for overlapped region
|
||||||
|
! better EINTR handling on *nix
|
||||||
|
! FTP proxy debugging output removed (introduced in 0.7), binding for data connection corrected
|
||||||
|
! memory leak fixed in ldapauth plugin
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
+ IPv6 support
|
||||||
|
+ back connect support
|
||||||
|
+ name resolution over TCP, parent proxy support for dnspr
|
||||||
|
+ SSLPlugin for TLS/SSL traffic decryption
|
||||||
|
! multiple race conditions fixed
|
||||||
|
! reduced memory usage
|
||||||
|
! Generate Forwarded: header instead of X-Forwarded-For:
|
||||||
|
! Default name resolution is non-blocking in *nix
|
||||||
|
! multiple race conditions fixed on configuration reload
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
!!Fix: destination IP may be not checked against ACL
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
! Fix: parent proxy can be used in some cases where it shouldn't
|
||||||
|
! Fix: bandlimiters may not work for older connections on configuration reload
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Minor bugfixes / improvements:
|
||||||
|
! Fixed: deadlock on insufficient resources
|
||||||
|
! Fixed: race condition in ssl_plugin
|
||||||
|
! Fixed: minor memory leak on configuration reload
|
||||||
|
! Fixed: recursion detection was not working
|
||||||
|
! Fixed: %n for IPv6 in logging terminates log record
|
||||||
|
! Fixed: reverse PTR validation (required for dnsauth)
|
||||||
|
! Fixed: error on external 0.0.0.0 for NOIPV6 (light version)
|
||||||
|
+ Better support for IPv6 in ftppr
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed hostname support in SOCKSv5 UDP portmapping
|
||||||
|
! -fno-strict-aliasing added to gcc options (compiling without this option can lead to unpredictable issues under Debian with gcc 6 and potentially others)
|
||||||
|
! Fixed LDAP plugin compilation issues (LDAP plugin is still listed as unsupported though)
|
||||||
|
and some minor fixes and improvements.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Bugfixes:
|
||||||
|
!! Fixed out-of-bound write and few minor bugs on configuration saving in admin
|
||||||
|
! fixed: $ is not correctly handled in the beginning of quoted line on configuration parsing
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
!! Fix transparent flag not reset after keep-alive connection, can lead to DoS by authenticated user.
|
||||||
|
! Do not use SO_REUSEADDR by default (leads to random 00013 errors under some glibc versions)
|
||||||
|
! Use SASIZE() instead of sizeof() in bind() for FreeBSD compatibility
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! fixed: use SASIZE() instead of sizeof() in connect() for FreeBSD compatibility
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
+ Build PamPlugin on *nix
|
||||||
|
+ stacksize and -S options, stacksize defaults changed for FreeBSD
|
||||||
|
+ extip redirection type added
|
||||||
|
! SSL plugin fix to correct handling of certificates path
|
||||||
|
! fixed random errors on IPv6 connect
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
!Fix: mutex was used prior to initialization on 'log' command processing
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! Fix: random 00012 errors in some configurations
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
! Fix 'daemon' command for Linux
|
||||||
|
! Fix 'extip' redirections 00009 errors
|
||||||
|
! Fix counters for older Win platforms
|
||||||
|
! Resolve logging race conditions
|
||||||
|
! attempt to fix pam_auth race conditions
|
||||||
|
! FTP proxy workaround for broken gethostname() on some libc limplementations
|
||||||
|
! authcache IP matching corrected
|
||||||
|
! fix SOCKSv5 BIND/UDP ASSOC
|
||||||
|
! use setreuid/setregid instead of setuid / setgid
|
||||||
|
|
||||||
|
+ OpenWatcom makefiles for Windows
|
||||||
|
+ -u2 support for proxy
|
||||||
|
+ support %i in logformat
|
||||||
|
+ force/noforce configuration commands to disconnect / do not disconnect clients if nolonger match ACL after configuration change
|
||||||
|
+ support longer external passwords
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
!! Fix resolver for non-compressed reply parsing (on mixed-case sensitive resolvers)
|
||||||
|
! Fix plugins export on OpenWatcom compiler (light version)
|
||||||
|
! Fix SOCKSv5
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
! Fix: tcppm may fail if used with parent proxy
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
+ Socket options, interface binding
|
||||||
|
+ Connection limiting / connection rate limiting
|
||||||
|
+ RADIUS support (beta)
|
||||||
|
+ Zero copy (splice) support for Linux
|
||||||
|
+ Possibility to limit user to single IP (via authentication cache)
|
||||||
|
! bugfixes, improvements
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: socket may be closed before all data received/sent
|
||||||
|
! Fixed: bandlimin non-working
|
||||||
|
! Fixed: countall/nocountall
|
||||||
|
! Fixed: few race conditions
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ deb/rpm build, systemd support (experimental)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: bandwidth limiters (once again)
|
||||||
|
! Fixed: data filtering plugins (PCREPlugin, SSLPlugin). SSLPlugin use on Linux requires to disable splice (-s0)
|
||||||
|
! FIxed: standalone proxies do not react on HUP (Ctrl+C) in Linux/Unix
|
||||||
|
! Fixed: few minor bugs
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ deb for arm platforms (experimental)
|
||||||
|
+ Openssl 1.1 support for SSLPlugin
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
Bugfixes:
|
||||||
|
! Fixed: systemd description file (proxy may fail to start after reboot or via systemctl)
|
||||||
|
! Fixed: group/account creation in installation scripts
|
||||||
|
! Fixed: countall/nocounall do not work in some configurations
|
||||||
|
! Fixed: counters do not work if counter file is not specified
|
||||||
|
! Fixed: counters without rotation (type N) are incorrectly shown in web admin interface
|
||||||
|
! Fixed: %n may be incomplete or missed in long log records
|
||||||
|
! Fixed: connect back functionality does not work
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
+ Docker builds
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
! Fix: invalid handling of '-' character in ACL hostname
|
||||||
|
! Fix: minor bugfixes and improvements
|
||||||
|
+ parentretry command added (defaults to 2) to retry connections to parent proxies
|
||||||
|
- icqpr related code (OSCAR proxy) removed, due to drop of OSCAR support by messengers
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
!! Security fix: proxy can potentially crash on on some platforms due to overlapping regions in strcpy() (thanks to @lenix123 for reporting)
|
||||||
|
+ new proxy service type: `tlspr` - SNI proxy, may also be used as parent `tls` type, sniffs hostname from TLS handhake, read more in https://github.com/3proxy/3proxy/wiki/tlspr https://github.com/3proxy/3proxy/wiki/How-To-(incomplete)#TLSPR
|
||||||
|
+ new proxy service type: `auto` - autodetect proxy type between `proxy` and `socks`
|
||||||
|
+ SSLPlugin is rewritten, production-ready, supports TLS (SSL) server (may be used to create https:// type proxy), certificates checks and cypher options, see https://github.com/3proxy/3proxy/wiki/SSLPlugin
|
||||||
|
+ -g option is added for grace delay to reduce CPU load, see https://github.com/3proxy/3proxy/wiki/High-Load
|
||||||
|
! Multiple minor bugfixes
|
||||||
|
! More supported sockets options
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
+ ssl_client and multiple configuration options added to SSLPlugin, SSLPlugin code significantly improved and bugfixed. See https://github.com/3proxy/3proxy/wiki/SSLPlugin. 3proxy can now be used as stunnel replacement for many scenarios.
|
||||||
|
+ HAProxy proxy protocol v1 support as client and server, add -H option for service to expect HA proxy v1 protocol header, use ha parent type: parent 1000 ha 0.0.0.0 0 to send v1 header.
|
||||||
|
+ tlspr is supported in auto
|
||||||
|
+ tlspr supports -s option, it breaks HELLO packet to prevent some DPIs from detecting SNI
|
||||||
|
+ maxseg configuration option and TCP_MAXSEG socket flag support added. It sets maximum size of TCP segment to fix PathMTU discovery problems
|
||||||
|
+ -Ne / -Ni options added to specify external / internal NAT address for SOCKSv5
|
||||||
|
+ cmake environment added
|
||||||
|
! External pcre2 (pcre2-8) library is used for PCRE, pcre code is removed from 3proxy
|
||||||
|
! Multiple minor bugfixes
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
+ PCRE2 and SSL/TLS code moved from plugins into main 3proxy binary; dynamic linking with ssl/pcre by default, STATIC/LIBSTATIC options for static linking
|
||||||
|
+ Unix sockets support for parent proxies, tcppm, internal listeners and -i option; abstract (fileless) unix sockets on Linux
|
||||||
|
+ ssl_client_mode = 3 to use 'secure' parent types: https, tcps, socks5s, connect+s, etc.
|
||||||
|
+ New authcache types: cacheacl, dstaddr, dstport, dsthost, dstoper, srvaddr, srvport; authcache is now configurable per service
|
||||||
|
+ Hashtables for password lists and authcache, faster password lookups
|
||||||
|
+ 3proxy_crypt: new internal password hashing replacing mycrypt
|
||||||
|
+ udppm switched to hashtables and supports multiple connections
|
||||||
|
+ SOCKSv5 UDP parent support; -Ne/-Ni NAT options
|
||||||
|
+ Docker images for more platforms, signed; DLLs signed; public cert added to build
|
||||||
|
+ Grace sleep and linger on connection close; correctly process half-closed connections
|
||||||
|
+ Allow setting internal/external network namespaces on Linux
|
||||||
|
- icqpr/OSCAR code removed
|
||||||
|
! Fix: invalid error in SSL server handshake could break service state
|
||||||
|
! Fix: invalid offset in datafilters
|
||||||
|
! Fix: invalid socket in poll() could break sockmap() on Windows
|
||||||
|
! Fix: deadlock in ftppr
|
||||||
|
! Fix: crash on standalone services
|
||||||
|
! Fix: non-initialized mutex crash under Windows
|
||||||
|
! Fix: socks v5 parent with no auth
|
||||||
|
! Fix: hanging connections in sockmap; unneeded poll in sockmap
|
||||||
|
! Fix: symbols collision with OpenSSL could lead to crash
|
||||||
|
! Fix: compatibility with older SSL versions and older Windows (7 and below)
|
||||||
|
! Multiple minor bugfixes and code cleanup
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
!! Fix: use-after-free on the ftp:// request path in HTTP proxy, a request buffer reallocation left a stale pointer; heap corruption, requires authenticated access
|
||||||
|
!! Fix: buffer overflow in radsend() with an oversized request hostname; RADIUS is experimental, log radius or auth radius with fakeresolve is required to reach it
|
||||||
|
!! Fix: buffer overflow in smtpp when relaying AUTH LOGIN credentials to a server which offers AUTH PLAIN only; requires authorised access to smtpp
|
||||||
|
!! Fix: out-of-bounds read in tlspr on a malformed TLS ClientHello
|
||||||
|
!! Fix: LDAP injection and unsafe counter file names in LdapPlugin; the plugin is unsupported and is not built with 3proxy
|
||||||
|
!! Fix: password and hash comparison in strong authentication is constant-time now
|
||||||
|
!! Fix: bounds validation and match/depth limits in pcre filters
|
||||||
|
+ imapp: IMAPv4 proxy added, supports LOGIN command, AUTH PLAIN and AUTH LOGIN
|
||||||
|
+ STARTTLS support for smtpp, pop3p, imapp and tlspr, on both client and server side; -x option to disable
|
||||||
|
+ wolfSSL is supported as an alternative TLS backend, WOLFSSL_CHECK=true selects it (wolfSSL must be built with --enable-opensslextra)
|
||||||
|
+ Chunked Transfer-Encoding from client is supported by HTTP proxy
|
||||||
|
+ dnspr: -F option added, fake resolve to redirect traffic
|
||||||
|
+ ucrt64 build support; static libraries support in Makefile.win
|
||||||
|
+ minimal and busybox Docker images switched to musl + wolfSSL
|
||||||
|
- splice() support is not built by default anymore, it is slower than the read/write path for most traffic; add -DWITHSPLICE to build it
|
||||||
|
! Fix: hashtable item was added with wrong index on table grow; with large username/password tables it could cause a single record to be missing
|
||||||
|
! Fix: race conditions; stack overflow on FreeBSD
|
||||||
|
! Fix: generated certificates are X.509 v3 with basicConstraints CA:FALSE and extendedKeyUsage serverAuth, required by Apple TLS stack and by Chrome on macOS/iOS
|
||||||
|
! Fix: dnspr was broken since udppm rewrite
|
||||||
|
! Fix: short cleartext passwords failed authentication
|
||||||
|
! Fix: parent negotiation after sending PROXY protocol header
|
||||||
|
! Fix: maxchild dropped to 100 on config reload if not set explicitly
|
||||||
|
! Fix: getrandom() is not used with glibc below 2.25
|
||||||
|
! Fix: IPV6_BOUND_IF definition for legacy MacOS
|
||||||
|
! Fix: cmake build, arm64 Docker build, Makefile.win with UCRT
|
||||||
|
! Multiple minor bugfixes and code cleanup
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
! Fix: DNS replies are validated now: a reply from an address other than the nameserver the query was sent to, and a reply with a question section not matching the query, are dropped; both were accepted before
|
||||||
|
! Fix: socket leak with SOCKSv5 UDP ASSOCIATE through a parent proxy, sockets were accumulated in CLOSE_WAIT state until descriptors ran out
|
||||||
|
! Fix: file descriptor leak in HTTP proxy on the ftp:// request path
|
||||||
|
! Fix: crash with illegal instruction on some platforms (e.g. some musl based Linux builds), caused by a memcpy on overlapping buffers
|
||||||
|
! Fix: extip and ha (HAProxy PROXY protocol) parents are applied to SOCKSv5 UDP ASSOCIATE now
|
||||||
|
! Fix: only socks5 and socks5+ parents are tried for UDP ASSOCIATE, other parent types can not be used for UDP
|
||||||
|
! Fix: udppm through a SOCKSv5 parent did not work
|
||||||
|
! Fix: -Ne and -Ni options were never applied, the option letter was not parsed; -Ne is not applied to the UDP ASSOCIATE reply anymore, -Ni is applied to it
|
||||||
|
! Fix: -4 / -6 handling for UDP in socks; a single UDP association can use both IPv4 and IPv6 destinations now
|
||||||
|
! Fix: a datagram with a null destination address is dropped now
|
||||||
|
! Fix: DNS over TCP: a reply which did not fit a single read was never processed
|
||||||
|
! Documentation: "How to apply ACLs to UDP traffic" added to HOWTO; authentication cache, ACL and UDP notes added to "Optimizing 3proxy for High Load" and to security recommendations
|
||||||
|
+ SOCKSv5 UDP: the destination of every datagram is authorized, so ACLs limiting the destination address, host name or port apply to UDP traffic now; the parent proxy and the external address are selected for the destination of the datagram and not for the UDP ASSOCIATE request
|
||||||
|
+ socks: -U option to control what happens when the destination changes within an UDP association: log it, authorize it, both (default) or neither
|
||||||
|
+ -C option (for TCP services) to terminate the session as soon as any of the sides closes the connection; by default the session is kept until both sides close it (TCP half-close)
|
||||||
|
+ timeouts: LINGER value added (11th, default 5), used to deliver buffered data after one of the sides has closed its sending side and as SO_LINGER value on outgoing connections
|
||||||
@@ -1,508 +0,0 @@
|
|||||||
{\rtf1\adeflang1025\ansi\ansicpg1251\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1049\deflangfe1049{\fonttbl{\f0\froman\fcharset204\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fmodern\fcharset204\fprq1{\*\panose 02070309020205020404}Courier New;}
|
|
||||||
{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f39\froman\fcharset0\fprq2 Times New Roman;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;}
|
|
||||||
{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
|
|
||||||
{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f59\fmodern\fcharset0\fprq1 Courier New;}{\f57\fmodern\fcharset238\fprq1 Courier New CE;}
|
|
||||||
{\f60\fmodern\fcharset161\fprq1 Courier New Greek;}{\f61\fmodern\fcharset162\fprq1 Courier New Tur;}{\f62\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f63\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
|
|
||||||
{\f64\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f65\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;
|
|
||||||
\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
|
|
||||||
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 \snext0 Normal;}{\*\cs10 \additive \ssemihidden
|
|
||||||
Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
|
||||||
\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}
|
|
||||||
{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid-1938272566{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \fbias0 \fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-360\li360\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720
|
|
||||||
\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720
|
|
||||||
\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-1080\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \fbias0 \fi-1080\li1080\jclisttab\tx1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers
|
|
||||||
\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
|
||||||
\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
|
|
||||||
\levelspace0\levelindent0{\leveltext\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1800\li1800\jclisttab\tx1800\lin1800 }{\listname ;}\listid233053280}
|
|
||||||
{\list\listtemplateid269381388\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1994686728\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0
|
|
||||||
\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-2036938464\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }
|
|
||||||
{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1578941516\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255
|
|
||||||
\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid936021434\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-1323636224\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0
|
|
||||||
{\leveltext\leveltemplateid-1892018578\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-108487922
|
|
||||||
\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-4969626\'00;}{\levelnumbers;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1135759886\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listname
|
|
||||||
;}\listid243993609}{\list\listtemplateid1411046654{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360
|
|
||||||
\jclisttab\tx360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }
|
|
||||||
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1440\jclisttab\tx1440\lin1440 }{\listlevel
|
|
||||||
\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1800\jclisttab\tx1800\lin1800 }{\listlevel
|
|
||||||
\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li2520\jclisttab\tx2520\lin2520 }
|
|
||||||
{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li2880
|
|
||||||
\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\fbias0 \fi-1440\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers
|
|
||||||
\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li3960\jclisttab\tx3960\lin3960 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
|
|
||||||
\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1800\li4680\jclisttab\tx4680\lin4680 }{\listname ;}\listid368384829}{\list\listtemplateid1424627480\listhybrid
|
|
||||||
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid1868871046\'01-;}{\levelnumbers;}\loch\af0\hich\af0\dbch\af0\fbias0 \fi-360\li420\jclisttab\tx420\lin420 }{\listlevel
|
|
||||||
\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1140\jclisttab\tx1140\lin1140 }{\listlevel\levelnfc23\levelnfcn23
|
|
||||||
\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li1860\jclisttab\tx1860\lin1860 }{\listlevel\levelnfc23\levelnfcn23\leveljc0
|
|
||||||
\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747265\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li2580\jclisttab\tx2580\lin2580 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
|
|
||||||
\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3300\jclisttab\tx3300\lin3300 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
|
|
||||||
\lvltentative\levelspace0\levelindent0{\leveltext\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4020\jclisttab\tx4020\lin4020 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
|
|
||||||
\levelspace0\levelindent0{\leveltext\leveltemplateid68747265\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li4740\jclisttab\tx4740\lin4740 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
|
|
||||||
\levelindent0{\leveltext\leveltemplateid68747267\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5460\jclisttab\tx5460\lin5460 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
|
|
||||||
\leveltemplateid68747269\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6180\jclisttab\tx6180\lin6180 }{\listname ;}\listid634527506}{\list\listtemplateid1914202178\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat1\levelspace0\levelindent0{\leveltext\leveltemplateid745160830\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0
|
|
||||||
\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-1816475770\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0
|
|
||||||
{\leveltext\leveltemplateid-715330988\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1569232270
|
|
||||||
\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-297370836\'00;}{\levelnumbers;}\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-346936770\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel
|
|
||||||
\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid416698944\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0
|
|
||||||
\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-596467262\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0
|
|
||||||
\levelspace0\levelindent0{\leveltext\leveltemplateid11278156\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listname ;}\listid1261259807}}{\*\listoverridetable{\listoverride\listid1261259807\listoverridecount0\ls1}
|
|
||||||
{\listoverride\listid634527506\listoverridecount0\ls2}{\listoverride\listid233053280\listoverridecount0\ls3}{\listoverride\listid243993609\listoverridecount0\ls4}{\listoverride\listid368384829\listoverridecount0\ls5}}{\*\rsidtbl \rsid1339617\rsid1586505
|
|
||||||
\rsid1600374\rsid1771507\rsid1986875\rsid2235853\rsid2296829\rsid2567226\rsid2701137\rsid3560132\rsid3671104\rsid3692728\rsid4980816\rsid5776876\rsid5975359\rsid6257560\rsid6570302\rsid7013593\rsid7235628\rsid7749673\rsid8087560\rsid8326885\rsid8672163
|
|
||||||
\rsid8675175\rsid9981679\rsid10440144\rsid10497064\rsid10908886\rsid12060716\rsid12261729\rsid12544729\rsid12806430\rsid13111076\rsid13909505\rsid15236432\rsid15609114\rsid15928529\rsid16077654}{\*\generator Microsoft Word 11.0.0000;}{\info
|
|
||||||
{\title 3proxy developer reference}{\author Vladimir Dubrovin}{\operator Vladimir Dubrovin}{\creatim\yr2007\mo11\dy23\hr19\min28}{\revtim\yr2008\mo1\dy22\hr19\min28}{\version8}{\edmins86}{\nofpages8}{\nofwords2396}{\nofchars13662}{\*\company Sandy}
|
|
||||||
{\nofcharsws16026}{\vern24611}{\*\password 00000000}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}{\xmlns2 urn:schemas-microsoft-com:office:smarttags}}
|
|
||||||
\paperw11906\paperh16838\margl1701\margr850\margt1134\margb1134\gutter0\ltrsect
|
|
||||||
\deftab708\widowctrl\ftnbj\aenddoc\donotembedsysfont1\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin
|
|
||||||
\dghspace180\dgvspace180\dghorigin1701\dgvorigin1134\dghshow1\dgvshow1
|
|
||||||
\jexpand\viewkind1\viewscale130\viewzk2\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\viewnobound1\snaptogridincell
|
|
||||||
\allowfieldendsel\wrppunct\asianbrkrule\rsidroot10497064\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1
|
|
||||||
\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5
|
|
||||||
\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
|
|
||||||
{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0
|
|
||||||
\fs24\lang1049\langfe1049\cgrid\langnp1049\langfenp1049 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13111076
|
|
||||||
\par }\pard \ltrpar\qc \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2235853 {\rtlch\fcs1 \af0\afs32 \ltrch\fcs0 \fs32\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12261729 3proxy developer reference}{
|
|
||||||
\rtlch\fcs1 \af0\afs32 \ltrch\fcs0 \fs32\lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang1033\langfe1049\langnp1033\insrsid2235853\charrsid12261729 $Id: devref.rtf,v 1.4 2008/01/24 08:44:57 vlad Exp $
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12060716 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar
|
|
||||||
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid10497064\charrsid12060716 Understanding Internal 3proxy structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10497064 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par 3proxy is implemented as multithread application. Server model is implemented as \'93one connection \endash one thread\'94. It means, for every client connection new thre
|
|
||||||
ad is created. This model is effective enough under Windows, because it allows it avoid thread creation on asynchronous operations, yet under most POSIX systems this model can not be considered as most efficient. It\rquote
|
|
||||||
s planned for (very far in future) release to implement more efficient model, where single thread can serve few clients.
|
|
||||||
\par
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 \hich\af0\dbch\af0\loch\f0 1.1\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 main thread:
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10497064 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
3proxy begins with main thread. This thread parses configuration}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 file and starts main loop}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064 . }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 During configuration file parsing }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid8672163 struct extaparam conf;}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 structure is filled and service threads are started.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 Main loop cycle }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 takes approximately 1 second and }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302 does these tasks:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10497064
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 re-reads configuration}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid8672163 file}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 , if necessary
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}performs scheduled tasks
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}monitors files (\lquote monitor}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 \rquote
|
|
||||||
command}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 )}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 , approx. once in a minute}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}rotates main logfile
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302 \hich\af0\dbch\af0\loch\f0 -\tab}dumps counters to }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
file, approx. once in a minute}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 performs termination, if required
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 I}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 t\rquote s guaranteed every configuration and schedule command is executed from the same thread.
|
|
||||||
|
|
||||||
\par Main thread is implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid12544729 3proxy.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \hich\af0\dbch\af0\loch\f0 1.2\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 service thread}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163
|
|
||||||
\par Service threads are started immediately, than service command (e.g. \lquote proxy\rquote or \lquote socks\rquote ) are found during configuration file parsing. Each command creates new thread. Thread does these tasks:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid8672163 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 parses service command arguments and fills \lquote }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid6257560 struct srvparam srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \rquote structure with service configuration and \lquote }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8672163\charrsid6257560 struct clientparam defparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8672163 \rquote structure with default client configuration
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 initializes filters}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 (filter_open)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560\charrsid8672163
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid6257560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 creates }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid2701137 and initializes }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6257560 listening service socket
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 enters into service loop}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}terminates filters (filter_close)
|
|
||||||
\par }\pard \ltrpar\ql \li60\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin60\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 service loop:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid2701137 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
checks for configuration reload (approximately every second), thread exits if configuration reloaded or 3proxy is in terminating state.
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137 \hich\af0\dbch\af0\loch\f0 -\tab}accepts client connection and creates \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid2701137 struct clientparam new}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2701137\charrsid6257560 param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2701137
|
|
||||||
\rquote structure with client configuration
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
creates/checks client filters (filter_client)
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 -\tab}creates client thread with newly created \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid3560132 struct clientparam new}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3560132\charrsid6257560 param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\rquote
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid6570302 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid6570302
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5975359 service threads are implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid7749673\charrsid12544729 proxymain.c}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5975359\charrsid7749673
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5975359
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 Please note: struct clientparam is freed and }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132\charrsid3560132 filter_clear}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 is executed from different (client) thread.
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 \hich\af0\dbch\af0\loch\f0 1.3\tab}}\pard \ltrpar\ql \fi-360\li360\ri0\widctlpar
|
|
||||||
\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls3\ilvl1\adjustright\rin0\lin360\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132 client thread
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749673 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
\par Client threads are started from service thread. Client thread:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid7749673 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
reads client request (except portmappers) with authentication information and request headers (if any).
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters request (if any) with }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_request}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7749673
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters headers (if any) with }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_header_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}performs authentication and authorization
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}established connection with server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}sends request to server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 filters server headers (if any)}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 maps client end s
|
|
||||||
erver sockets to transmit data between client and server
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 logs request. Global counters are also updated on this operation
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 clears client filters (}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_clear}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 )
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}frees }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876
|
|
||||||
struct clientparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 data
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10908886 in some point client thread may loop to process few client requests from the same connection (e.g. HTTP \lquote established\rquote connection in \lquote proxy\rquote ).
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 Socket mapping does:
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \ltrpar\ql \fi-360\li420\ri0\widctlpar
|
|
||||||
\jclisttab\tx420\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin420\itap0\pararsid5776876 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 caches data in internal client and server buffers
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}delays data transmit to limit bandwidth
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 \hich\af0\dbch\af0\loch\f0 -\tab}performs data filtering (}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876 filter_data_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 / }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876\charrsid5776876
|
|
||||||
filter_data_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid5776876 )
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3560132
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 client threads are implemented in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 proxy.c}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505 , }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 socks.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 , }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12544729 pop3p.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505 etc.
|
|
||||||
\par
|
|
||||||
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12060716 \hich\af0\dbch\af0\loch\f0 2.\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\widctlpar
|
|
||||||
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid1586505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid1586505\charrsid12060716 Hacking into 3proxy code with plugins
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3560132 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.1 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505 What is 3proxy plugin
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1586505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144 3proxy plugin is any dynamic/shared library. There is no specific requirement for plugin, actually you can load any dynamic library with \lquote plugin\rquote
|
|
||||||
command. No linking with any libraries are required. However, to interoperate with 3proxy dynamic library must have an export function 3proxy may call to pass the structure with required information.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1586505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid10440144\charrsid10440144 typedef int (*PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid10440144\charrsid10440144 struct pluginlink}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
is a structure with export information, explained later, argc and argv are argument counter and array of arguments of \'93plugin\'94 command. Plugin should report it\rquote
|
|
||||||
s status with integer return value. 0 is success, positive value indicates non-recoverable error, 3proxy do not parse rest of configuration and enters into termination state, negative value indicates recoverable value, 3proxy logs warning (if possible).}{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 In case of C++, all 3proxy functions/structures must be extern \'93C\'94.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15928529 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 All 3proxy structures/functions descriptions are located in
|
|
||||||
}{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15928529 structures.h}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li360\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.2 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 Understanding pluginlink structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par Because there is no linking between 3proxy and plugin, all 3proxy functions and structures are passed with pluginlink structure. Pluginlink is actually a collection of pointers to 3proxy internal structures and functions. Because plug
|
|
||||||
inlink is constantly extending, you should see it\rquote s definitions in }{\rtlch\fcs1 \af0 \ltrch\fcs0 \b\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid12544729 structures.h}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 .
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 most important}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 are:
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid8087560 struct symbol symbols;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 \'93symbols\'94
|
|
||||||
is a kind of name/value export table, made as a list. It can be used by plugins to exchange information and functions between plugins, e.g. to export functions from one plugin to another, where pluginlink is useless, because it\rquote s static. It
|
|
||||||
\rquote s quite simple:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8087560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8087560\charrsid8087560 struct symbol \{
|
|
||||||
\par \tab struct symbol *next;
|
|
||||||
\par \tab char * name;
|
|
||||||
\par \tab void * value;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 n}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 ame \endash is a name of function or structure
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 v}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 alue \endash is it\rquote s value.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 u}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 se}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560
|
|
||||||
pluginlink->fundbyname function to lookup, e.g.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid8087560\charrsid13909505 anotherplugindata = pluginlink->findbyname(\'93anotherplugindata\'94);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560 To export }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 something from your plugin, add your structure to this list.}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560\charrsid8087560
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8087560\charrsid12544729
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12544729\charrsid13909505 struct extparam *conf;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 pointer to conf structure, it holds all current 3proxy configuration
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729\charrsid12544729
|
|
||||||
\par }\pard \ltrpar\ql \li360\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin360\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2296829 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid12544729 How to get control within plugin}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid10440144
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12544729 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729
|
|
||||||
\par There are few points you can get control for your plugin, after it\rquote s loaded with \lquote plugin\rquote command.
|
|
||||||
\par
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.1 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12544729 Adding configuration command processor with struct command structure
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par A list of configuration file command, available from 3proxy.cfg is extendable. Each command is defined by }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid13909505 :
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands \{
|
|
||||||
\par \tab struct commands *next;
|
|
||||||
\par \tab char * command;
|
|
||||||
\par \tab int (* handler)(int argc, unsigned char ** argv);
|
|
||||||
\par \tab int minargs;
|
|
||||||
\par \tab int maxargs;\tab
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 struct commands *next}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 - next element in list}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 char * command}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash command name
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505 int (* handler)(i}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505 nt argc, unsigned char ** argv)}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash command handler. It\rquote s called than \lquote command\rquote is found in configuration files, argc is a number of arguments, counting command itself, argv is array of arguments.
|
|
||||||
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid13909505\charrsid12060716 minargs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505 \endash minimum number of arguments command support (>= 1)
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 maxargs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 \endash
|
|
||||||
maximum number of arguments command support, 0 means infinity.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505\charrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 Handler r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
eturn value of 0 indicates command is successfully processed. Positive return value indicates non-recoverable error, 3proxy enter}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 s}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3671104 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 termination state. Negative value indicate
|
|
||||||
s 3proxy to continue to process command list, it makes it possible to set few handlers for the same command.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 A list of the command is pointed by pluginlinks->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 commandhandlers}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 ; you must insert you command after first one (do not replace pluginlink->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 commandhandlers}{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 ). It\rquote s guaranteed at least 1 dummy command is always present.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par Example:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 int mycommandhandler(int argc, unsigned char **argv);
|
|
||||||
\par struct commands mycommand;
|
|
||||||
\par
|
|
||||||
\par mycommand.command = \'93mycommand\'94;
|
|
||||||
\par mycommand.handler = mycommandhandler;
|
|
||||||
\par mycommand.intargs = 1;
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12060716 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid12060716\charrsid12060716 mycommand.intargs = 2;
|
|
||||||
\par mycommand.next = pluginslinks->commandhandlers->next;
|
|
||||||
\par pluginslink->commandhandlers->next = &mycommand;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par Adds processor for \'93mycommand\'94 command with zero on one arguments.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716\charrsid13909505
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid13909505
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716 Adding configuration command is useful, if your plugin expects configuration data.
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.2 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 Adding authentication method with }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104 struct auth}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid3671104 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par 3proxy supports authentication and authorization. Authentication process determines user account (for example by user
|
|
||||||
name and password), authorization checks, if user account has a right to access given resource and optionally establishes a connection, if required.
|
|
||||||
\par
|
|
||||||
\par \lquote auth\rquote command combines both authentication and authorization method. It\rquote s extandable with struct auth list:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 struct auth \{
|
|
||||||
\par \tab struct auth *next;
|
|
||||||
\par \tab AUTHFUNC authenticate;
|
|
||||||
\par \tab AUTHFUNC authorize;
|
|
||||||
\par \tab char * desc;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 char * desc}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authentication/authorization method}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 authenticate}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authentication function}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12060716
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid3671104\charrsid16077654 authorize}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104 \endash name of authorization function
|
|
||||||
\par
|
|
||||||
\par pluginlink->}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104\charrsid3671104 authfuncs}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid3671104
|
|
||||||
points to list of authenticataction structures. Like above, new structure must be inserted after fiest one (or to the end of the list).
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par First, authentication is called, if authentication indicates OK status (return value 0), authorization is called. Normally, \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654\charrsid16077654 checkACL}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 \rquote (pluginlink->checkACL) is called as authorization function to check user\rquote s request matches to standard allow/deny rules.
|
|
||||||
If for some reason you need to avoid this check, you should call pluginlink->alwaysauth to do some dirty job, like establishing outgoing connection.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid16077654\charrsid4980816 typedef int (*AUTHFUNC)(struct clientparam * param);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par is both authentication and authorization function. \lquote }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654\charrsid16077654 struct clientparam}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\rquote holds all information about client connection, including username (param->username) and password (param->password).
|
|
||||||
\par
|
|
||||||
\par Return value of 0 indicates successful authentication/authorization, 1}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374 and 3}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654 \endash
|
|
||||||
authorization }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374 failed (access denied), use {\*\xmlopen\xmlns2{\factoidname metricconverter}{\xmlattr\xmlattrns0{\xmlattrname ProductID}{\xmlattrvalue 3 in}}}3 in{\*\xmlclose}
|
|
||||||
case you want to indicate access is explicitly denied and {\*\xmlopen\xmlns2{\factoidname metricconverter}{\xmlattr\xmlattrns0{\xmlattrname ProductID}{\xmlattrvalue 3 in}}}3 in{\*\xmlclose} case there is no matching rule. 4,5,6,7,8 \endash
|
|
||||||
authentication failed (e.g. username/password do not match). 4 indicates username }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 does not present in request and }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1600374 must be requested, if possible. 5 indicates username }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 found in request }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1600374 can not be found in user\rquote s database/list, 6,7,8 \endash username does not match password for different authentication types. 10 \endash user exceeded some limits, e.g. tr
|
|
||||||
affic. You may use some different code to indicate internal problems.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid16077654
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374
|
|
||||||
\par Example:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1600374\charrsid1600374 int myauthfunc(struct clientparam *param);
|
|
||||||
\par struct auth myauth;
|
|
||||||
\par
|
|
||||||
\par myauth.desc = \'93myauth\'94;
|
|
||||||
\par myauth.authenticate = myauthfunc;
|
|
||||||
\par myauth.authorize = pluginlink->checkACL;
|
|
||||||
\par myauth->next = pluginlink->authfuncs->next;
|
|
||||||
\par pluginlink->authfuncs->next = &myauth;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1600374
|
|
||||||
\par Installs \'93myauthfunc\'94 as authentication function.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7235628 There is no need to add \lquote auth\rquote command processor for new authentication type, it\rquote
|
|
||||||
s processed by standard \lquote auth\rquote command processor.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7235628
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2296829 2.3.3 }{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430 Adding scheduled functions
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 Scheduled functions are described by this structure:
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 typedef enum \{NONE, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, ANNUALLY, NEVER\} ROTATION;
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid4980816\charrsid15236432 struct schedule \{
|
|
||||||
\par \tab struct schedule *next;
|
|
||||||
\par \tab ROTATION type;
|
|
||||||
\par \tab void *data;
|
|
||||||
\par \tab int (*function)(void *);
|
|
||||||
\par \tab time_t start_time;
|
|
||||||
\par \};
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15928529 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 int (*function)(void *)}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash scheduled function}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529\charrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 void *data}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash
|
|
||||||
this pointer will be passed as an argument to scheduled functions}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529\charrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 ROTATION type}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash
|
|
||||||
defines how often function is called (once in a minute, hour, etc).
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 start_time}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 \endash time to begin using of scheduled function
|
|
||||||
\par
|
|
||||||
\par Scheduled functions are called every \lquote type\rquote interval after start_time and also on reloading configuration and going to termination state.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 Schedule function r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529 eturn value of 1 means function must be
|
|
||||||
removed from the schedule. 3proxy doesn\rquote t free struct schedule.
|
|
||||||
\par
|
|
||||||
\par Schedule list can be empty. Pointer to schedule is pointed by }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432 struct schedule ** schedule;}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15928529 in pluginlink.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 Example:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 int myschedfunc(void * data);
|
|
||||||
\par struct schedule myschedule;
|
|
||||||
\par
|
|
||||||
\par myschedule.data = \'93somethinghere\'94;
|
|
||||||
\par myschedule.function = myschedfunc}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432 ;}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12806430 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 myschedule.type = MINUTELY;}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15928529\charrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 myschedule.starttime = 0;
|
|
||||||
\par myschedule.next = *pluginlink->schedule;
|
|
||||||
\par *pluginlink->schedule = myschedule;
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid15236432 NOTE:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 time_t is different for different compilers.
|
|
||||||
Make sure to compile plugin and 3proxy with same compiler.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15928529
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 2.3.4 Filters API
|
|
||||||
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432 3proxy has filters API, you can use, to process client request and data flowing through proxy. It should be noted, that currently 3proxy doesn\rquote
|
|
||||||
t provide filters with any useful data conversion, so, it\rquote s filter\rquote s task to find data in data flow. In case filter modifies some data, it\rquote s filter\rquote s task again to assure that everything\rquote s fine.}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 If you know some filtering API like MILTER, you will find 3proxy filters very same.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15236432 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid15236432\charrsid1771507 typedef enum \{
|
|
||||||
\par \tab PASS,
|
|
||||||
\par \tab CONTINUE,
|
|
||||||
\par \tab HANDLED,
|
|
||||||
\par \tab REJECT,
|
|
||||||
\par \tab REMOVE
|
|
||||||
\par \} FILTER_ACTION;
|
|
||||||
\par
|
|
||||||
\par typedef\tab void*\tab \tab FILTER_OPEN(void * idata, struct srvparam * param);
|
|
||||||
\par typedef\tab FILTER_ACTION \tab FILTER_CLIENT(void *fo, struct clientparam * param, void** fc);
|
|
||||||
\par typedef\tab FILTER_ACTION\tab FILTER_BUFFER(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p);
|
|
||||||
\par typedef\tab void\tab \tab FILTER_CLOSE(void *fo);
|
|
||||||
\par
|
|
||||||
\par struct filter \{
|
|
||||||
\par \tab struct filter * next;
|
|
||||||
\par \tab char * instance;
|
|
||||||
\par \tab void * data;
|
|
||||||
\par \tab FILTER_OPEN *filter_open;
|
|
||||||
\par \tab FILTER_CLIENT *filter_client;
|
|
||||||
\par \tab FILTER_BUFFER *filter_request;
|
|
||||||
\par \tab FILTER_BUFFER *filter_header_cli;
|
|
||||||
\par \tab FILTER_BUFFER *filter_header_srv;
|
|
||||||
\par \tab FILTER_BUFFER *filter_data_cli;
|
|
||||||
\par \tab FILTER_BUFFER *filter_data_srv;
|
|
||||||
\par \tab FILTER_CLOSE *filter_clear;
|
|
||||||
\par \tab FILTER_CLOSE *filter_close;
|
|
||||||
\par \};
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1771507 {\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1771507 char * instance}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 \endash is some instance identifier. You can use it to find required filter in the list. 3proxy itself doesn\rquote t use this field.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid7013593
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1771507 void * data}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 \endash this parameter is passed to filter_open function.
|
|
||||||
\par The rest are filtering functions. Section 1 explains where and then each filter is called.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid7013593 data should not be NULL.}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1771507
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1986875 filter_open}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 must always be defined, if you want filter to be ever used. It
|
|
||||||
\rquote s called then new service is created and is given \'93data\'94 from struct filter and struct srvparam (parsed service configuration). If filter_op
|
|
||||||
en for some filter returns NULL, filter will not be used for this service. Non-NULL return value will be used as \'93fo\'94 parameter for every call to filter_client.
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1771507\charrsid1986875 filter_client}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid1986875 is called upon client connect (before any data is sent/received). It\rquote s good plac
|
|
||||||
e to filter client by IP (and is not good place to filter it by hostname, because this operation takes a long time, 3proxy will not be able to accept new connection). fo is a data pointer received from filter_open, param \endash
|
|
||||||
newly created clientparam structu
|
|
||||||
re, fc is return parameter filter_open must initialize, it will be used as an argument to FILTER_BUFFER functions. PASS return value means this filter will be used for this client request. CONTINUE says to install filters. On different values client conne
|
|
||||||
ction is closed and no client thread is created.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507\charrsid15236432
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15236432 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1771507
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 f}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 ilter_reques}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875 t, }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_header_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{
|
|
||||||
\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_header_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_data_cli}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 , }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1771507 filter_data_srv}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid1986875 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1986875
|
|
||||||
are used to process request and data r}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 eceived from client and server.}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid1986875\charrsid1986875
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15236432
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 char ** buf_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is a pointer to current buffer, }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 int * bufsize_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is a pointer to it\rquote s size. In case you change some data and it doesn\rquote
|
|
||||||
t fit to current buffer, you may allocate new buffer (with pluginlink->myalloc), copy data from old buffer, free old buffer (with pluginlink->myfree) and set new values for *}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 buf_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 and }{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 *}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 bufsize_p}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 .
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 int }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 * offset_p}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 offset of the new data in the buffer, }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 int * length_p}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 length of all data in the buffer. You should filter only (*length_p - *offset_p) characters starting from }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
(*buf_p + *offset_p)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 .}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid1771507 filter_clear}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679 }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679 is called for each successfule filter_client}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 and should be used to free allocated resources}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 filter_close}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 is called for each successful filter_open}{\rtlch\fcs1 \af0
|
|
||||||
\ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 for the same reason}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679
|
|
||||||
\par
|
|
||||||
\par An example of filter API usage you can find in PCREPlugin (see plugins/}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 PCREPlugin}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 /
|
|
||||||
}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679\charrsid9981679 pcre_plugin.c}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid9981679 ).
|
|
||||||
\par
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \ul\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114 Note}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114 : if }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114 param->nooverwritefilter}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114
|
|
||||||
is set for FILTER_BUFFER functions, filter may change data in the buffer, but must not change data length. This flag may be set, if data size if already known and is sent to the client. }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid15609114\charrsid15609114
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid15609114\charrsid9981679
|
|
||||||
\par {\listtext\tab}}\pard \ltrpar\ql \li0\ri0\widctlpar\jclisttab\tx360\wrapdefault\aspalpha\aspnum\faauto\ls4\ilvl2\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816 2.3.5
|
|
||||||
Replacing log functions, traffic counting functions, bandwidth limitation functions
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid4980816 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid4980816
|
|
||||||
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid13909505 {\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8326885
|
|
||||||
Log, traffic and bandwidth function can be directly replaced in any over place. All functions may be replaced in conf (pluginlink->conf->logfunc, pluginlink->conf->bandlim
|
|
||||||
func, pluginlink->conf->trafcountfunc). In this case, these functions will be used for services started after the changes are made. }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 l}{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid8326885 ogfunc may also be changed for }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 struct s}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid8326885
|
|
||||||
rvparam (e.g. within filter_open)}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 , bandlimfunc and trafcountfunc may be changed in struct clientparam for every client individually (e.g. within filter_client).}{\rtlch\fcs1
|
|
||||||
\af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid12806430
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 typedef void (*LOGFUNC)(struct clientparam * param, const unsigned char * test);
|
|
||||||
\par typedef void (*TRAFCOUNTFUNC)(struct clientparam * param); }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 typedef unsigned (*BANDLIMFUNC)(struct clientparam * param, unsigned nbytesin, unsigned nbytesout);
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 struct clientparam * param}{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226 \endash }{\rtlch\fcs1 \af0 \ltrch\fcs0
|
|
||||||
\lang1033\langfe1049\langnp1033\insrsid2567226 information about client request}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 char * text}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 - text string (e.g. request)
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \i\lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226 nbytesin, nbytesout}{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226 \endash
|
|
||||||
number of bytes received from / send to server. bandlimfunc returns delay in milliseconds.
|
|
||||||
\par }{\rtlch\fcs1 \af0 \ltrch\fcs0 \lang1033\langfe1049\langnp1033\insrsid2567226\charrsid2567226
|
|
||||||
\par }}
|
|
||||||
@@ -0,0 +1,259 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||||
|
<title>3proxy developer reference</title>
|
||||||
|
<style type="text/css">
|
||||||
|
span.s1 {text-decoration: underline}
|
||||||
|
ol {list-style-type: none}
|
||||||
|
ol.level1 {counter-reset: h1}
|
||||||
|
ol.level1 > li::before {content: counter(h1) ". "; counter-increment: h1; font-weight: bold}
|
||||||
|
ol.level2 {counter-reset: h2}
|
||||||
|
ol.level2 > li::before {content: counter(h1) "." counter(h2) " "; counter-increment: h2}
|
||||||
|
ol.level3 {counter-reset: h3}
|
||||||
|
ol.level3 > li::before {content: counter(h1) "." counter(h2) "." counter(h3) " "; counter-increment: h3}
|
||||||
|
pre {margin: 0.5em 0; padding: 0.5em; background: #f5f5f5; border: 1px solid #ddd}
|
||||||
|
code {font-family: monospace}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>3proxy developer reference</h2>
|
||||||
|
|
||||||
|
<ol class="level1">
|
||||||
|
<li><b>Understanding Internal 3proxy structure</b>
|
||||||
|
<p>3proxy is implemented as multithread application. Server model is implemented as "one connection – one thread". It means, for every client connection new thread is created. This model is effective enough under Windows, because it allows it avoid thread creation on asynchronous operations, yet under most POSIX systems this model can not be considered as most efficient. It's planned for (very far in future) release to implement more efficient model, where single thread can serve few clients.</p>
|
||||||
|
<ol class="level2">
|
||||||
|
<li>main thread
|
||||||
|
<p>3proxy begins with main thread. This thread parses configuration file and starts main loop. During configuration file parsing <code>struct extaparam conf;</code> structure is filled and service threads are started.</p>
|
||||||
|
<p>Main loop cycle takes approximately 1 second and does these tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>re-reads configuration file, if necessary</li>
|
||||||
|
<li>performs scheduled tasks</li>
|
||||||
|
<li>monitors files ('monitor' command), approx. once in a minute</li>
|
||||||
|
<li>rotates main logfile</li>
|
||||||
|
<li>dumps counters to file, approx. once in a minute</li>
|
||||||
|
<li>performs termination, if required</li>
|
||||||
|
</ul>
|
||||||
|
<p>It's guaranteed every configuration and schedule command is executed from the same thread.</p>
|
||||||
|
<p>Main thread is implemented in <b>3proxy.c</b></p>
|
||||||
|
</li>
|
||||||
|
<li>service thread
|
||||||
|
<p>Service threads are started immediately, than service command (e.g. 'proxy' or 'socks') are found during configuration file parsing. Each command creates new thread. Thread does these tasks:</p>
|
||||||
|
<ul>
|
||||||
|
<li>parses service command arguments and fills <code>struct srvparam srv</code> structure with service configuration and <code>struct clientparam defparam</code> structure with default client configuration</li>
|
||||||
|
<li>initializes filters (filter_open)</li>
|
||||||
|
<li>creates and initializes listening service socket</li>
|
||||||
|
<li>enters into service loop</li>
|
||||||
|
<li>terminates filters (filter_close)</li>
|
||||||
|
</ul>
|
||||||
|
<p>service loop:</p>
|
||||||
|
<ul>
|
||||||
|
<li>checks for configuration reload (approximately every second), thread exits if configuration reloaded or 3proxy is in terminating state.</li>
|
||||||
|
<li>accepts client connection and creates <code>struct clientparam newparam</code> structure with client configuration</li>
|
||||||
|
<li>creates/checks client filters (filter_client)</li>
|
||||||
|
<li>creates client thread with newly created <code>struct clientparam newparam</code></li>
|
||||||
|
</ul>
|
||||||
|
<p>service threads are implemented in <b>proxymain.c</b></p>
|
||||||
|
<p>Please note: struct clientparam is freed and filter_clear is executed from different (client) thread.</p>
|
||||||
|
</li>
|
||||||
|
<li>client thread
|
||||||
|
<p>Client threads are started from service thread. Client thread:</p>
|
||||||
|
<ul>
|
||||||
|
<li>reads client request (except portmappers) with authentication information and request headers (if any).</li>
|
||||||
|
<li>filters request (if any) with filter_request</li>
|
||||||
|
<li>filters headers (if any) with filter_header_cli</li>
|
||||||
|
<li>performs authentication and authorization</li>
|
||||||
|
<li>established connection with server</li>
|
||||||
|
<li>sends request to server</li>
|
||||||
|
<li>filters server headers (if any)</li>
|
||||||
|
<li>maps client end server sockets to transmit data between client and server</li>
|
||||||
|
<li>logs request. Global counters are also updated on this operation</li>
|
||||||
|
<li>clears client filters (filter_clear)</li>
|
||||||
|
<li>frees <code>struct clientparam</code> data</li>
|
||||||
|
</ul>
|
||||||
|
<p>in some point client thread may loop to process few client requests from the same connection (e.g. HTTP 'established' connection in 'proxy').</p>
|
||||||
|
<p>Socket mapping does:</p>
|
||||||
|
<ul>
|
||||||
|
<li>caches data in internal client and server buffers</li>
|
||||||
|
<li>delays data transmit to limit bandwidth</li>
|
||||||
|
<li>performs data filtering (filter_data_cli / filter_data_srv)</li>
|
||||||
|
</ul>
|
||||||
|
<p>client threads are implemented in <b>proxy.c</b>, <b>socks.c</b>, <b>pop3p.c</b> etc.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
<li><b>Hacking into 3proxy code with plugins</b>
|
||||||
|
<ol class="level2">
|
||||||
|
<li>What is 3proxy plugin
|
||||||
|
<p>3proxy plugin is any dynamic/shared library. There is no specific requirement for plugin, actually you can load any dynamic library with 'plugin' command. No linking with any libraries are required. However, to interoperate with 3proxy dynamic library must have an export function 3proxy may call to pass the structure with required information.</p>
|
||||||
|
<pre><code>typedef int (*PLUGINFUNC) (struct pluginlink *pluginlink, int argc, char** argv);</code></pre>
|
||||||
|
<p><code>struct pluginlink</code> is a structure with export information, explained later, argc and argv are argument counter and array of arguments of "plugin" command. Plugin should report it's status with integer return value. 0 is success, positive value indicates non-recoverable error, 3proxy do not parse rest of configuration and enters into termination state, negative value indicates recoverable value, 3proxy logs warning (if possible). In case of C++, all 3proxy functions/structures must be extern "C".</p>
|
||||||
|
<p>All 3proxy structures/functions descriptions are located in <b>structures.h</b></p>
|
||||||
|
</li>
|
||||||
|
<li>Understanding pluginlink structure
|
||||||
|
<p>Because there is no linking between 3proxy and plugin, all 3proxy functions and structures are passed with pluginlink structure. Pluginlink is actually a collection of pointers to 3proxy internal structures and functions. Because pluginlink is constantly extending, you should see it's definitions in <b>structures.h</b>.</p>
|
||||||
|
<p>most important are:</p>
|
||||||
|
<pre><code>struct symbol symbols;</code></pre>
|
||||||
|
<p>"symbols" is a kind of name/value export table, made as a list. It can be used by plugins to exchange information and functions between plugins, e.g. to export functions from one plugin to another, where pluginlink is useless, because it's static. It's quite simple:</p>
|
||||||
|
<pre><code>struct symbol {
|
||||||
|
struct symbol *next;
|
||||||
|
char * name;
|
||||||
|
void * value;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>name</code> – is a name of function or structure</p>
|
||||||
|
<p><code>value</code> – is it's value.</p>
|
||||||
|
<p>use <code>pluginlink->findbyname</code> function to lookup, e.g.</p>
|
||||||
|
<pre><code>anotherplugindata = pluginlink->findbyname("anotherplugindata");</code></pre>
|
||||||
|
<p>To export something from your plugin, add your structure to this list.</p>
|
||||||
|
<pre><code>struct extparam *conf;</code></pre>
|
||||||
|
<p>pointer to conf structure, it holds all current 3proxy configuration</p>
|
||||||
|
</li>
|
||||||
|
<li>How to get control within plugin
|
||||||
|
<p>There are few points you can get control for your plugin, after it's loaded with 'plugin' command.</p>
|
||||||
|
<ol class="level3">
|
||||||
|
<li>Adding configuration command processor with struct command structure
|
||||||
|
<p>A list of configuration file command, available from 3proxy.cfg is extendable. Each command is defined by <code>struct commands</code>:</p>
|
||||||
|
<pre><code>struct commands {
|
||||||
|
struct commands *next;
|
||||||
|
char * command;
|
||||||
|
int (* handler)(int argc, unsigned char ** argv);
|
||||||
|
int minargs;
|
||||||
|
int maxargs;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>struct commands *next</code> - next element in list</p>
|
||||||
|
<p><code>char * command</code> – command name</p>
|
||||||
|
<p><code>int (* handler)(int argc, unsigned char ** argv)</code> – command handler. It's called than 'command' is found in configuration files, argc is a number of arguments, counting command itself, argv is array of arguments.</p>
|
||||||
|
<p><code>minargs</code> – minimum number of arguments command support (>= 1)</p>
|
||||||
|
<p><code>maxargs</code> – maximum number of arguments command support, 0 means infinity.</p>
|
||||||
|
<p>Handler return value of 0 indicates command is successfully processed. Positive return value indicates non-recoverable error, 3proxy enters termination state. Negative value indicates 3proxy to continue to process command list, it makes it possible to set few handlers for the same command.</p>
|
||||||
|
<p>A list of the command is pointed by <code>pluginlink->commandhandlers</code>; you must insert you command after first one (do not replace <code>pluginlink->commandhandlers</code>). It's guaranteed at least 1 dummy command is always present.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int mycommandhandler(int argc, unsigned char **argv);
|
||||||
|
struct commands mycommand;
|
||||||
|
|
||||||
|
mycommand.command = "mycommand";
|
||||||
|
mycommand.handler = mycommandhandler;
|
||||||
|
mycommand.intargs = 1;
|
||||||
|
mycommand.intargs = 2;
|
||||||
|
mycommand.next = pluginslinks->commandhandlers->next;
|
||||||
|
pluginslink->commandhandlers->next = &mycommand;</code></pre>
|
||||||
|
<p>Adds processor for "mycommand" command with zero on one arguments.</p>
|
||||||
|
<p>Adding configuration command is useful, if your plugin expects configuration data.</p>
|
||||||
|
</li>
|
||||||
|
<li>Adding authentication method with struct auth
|
||||||
|
<p>3proxy supports authentication and authorization. Authentication process determines user account (for example by username and password), authorization checks, if user account has a right to access given resource and optionally establishes a connection, if required.</p>
|
||||||
|
<p>'auth' command combines both authentication and authorization method. It's extandable with struct auth list:</p>
|
||||||
|
<pre><code>struct auth {
|
||||||
|
struct auth *next;
|
||||||
|
AUTHFUNC authenticate;
|
||||||
|
AUTHFUNC authorize;
|
||||||
|
char * desc;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>char * desc</code> – name of authentication/authorization method</p>
|
||||||
|
<p><code>authenticate</code> – name of authentication function</p>
|
||||||
|
<p><code>authorize</code> – name of authorization function</p>
|
||||||
|
<p><code>pluginlink->authfuncs</code> points to list of authenticataction structures. Like above, new structure must be inserted after fiest one (or to the end of the list).</p>
|
||||||
|
<p>First, authentication is called, if authentication indicates OK status (return value 0), authorization is called. Normally, 'checkACL' (<code>pluginlink->checkACL</code>) is called as authorization function to check user's request matches to standard allow/deny rules. If for some reason you need to avoid this check, you should call <code>pluginlink->alwaysauth</code> to do some dirty job, like establishing outgoing connection.</p>
|
||||||
|
<pre><code>typedef int (*AUTHFUNC)(struct clientparam * param);</code></pre>
|
||||||
|
<p>is both authentication and authorization function. <code>struct clientparam</code> holds all information about client connection, including username (<code>param->username</code>) and password (<code>param->password</code>).</p>
|
||||||
|
<p>Return value of 0 indicates successful authentication/authorization, 1 and 3 – authorization failed (access denied), use 3 in case you want to indicate access is explicitly denied and 3 in case there is no matching rule. 4,5,6,7,8 – authentication failed (e.g. username/password do not match). 4 indicates username does not present in request and must be requested, if possible. 5 indicates username found in request can not be found in user's database/list, 6,7,8 – username does not match password for different authentication types. 10 – user exceeded some limits, e.g. traffic. You may use some different code to indicate internal problems.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int myauthfunc(struct clientparam *param);
|
||||||
|
struct auth myauth;
|
||||||
|
|
||||||
|
myauth.desc = "myauth";
|
||||||
|
myauth.authenticate = myauthfunc;
|
||||||
|
myauth.authorize = pluginlink->checkACL;
|
||||||
|
myauth->next = pluginlink->authfuncs->next;
|
||||||
|
pluginlink->authfuncs->next = &myauth;</code></pre>
|
||||||
|
<p>Installs "myauthfunc" as authentication function. There is no need to add 'auth' command processor for new authentication type, it's processed by standard 'auth' command processor.</p>
|
||||||
|
</li>
|
||||||
|
<li>Adding scheduled functions
|
||||||
|
<p>Scheduled functions are described by this structure:</p>
|
||||||
|
<pre><code>typedef enum {NONE, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, ANNUALLY, NEVER} ROTATION;
|
||||||
|
|
||||||
|
struct schedule {
|
||||||
|
struct schedule *next;
|
||||||
|
ROTATION type;
|
||||||
|
void *data;
|
||||||
|
int (*function)(void *);
|
||||||
|
time_t start_time;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>int (*function)(void *)</code> – scheduled function</p>
|
||||||
|
<p><code>void *data</code> – this pointer will be passed as an argument to scheduled functions</p>
|
||||||
|
<p><code>ROTATION type</code> – defines how often function is called (once in a minute, hour, etc).</p>
|
||||||
|
<p><code>start_time</code> – time to begin using of scheduled function</p>
|
||||||
|
<p>Scheduled functions are called every 'type' interval after start_time and also on reloading configuration and going to termination state.</p>
|
||||||
|
<p>Schedule function return value of 1 means function must be removed from the schedule. 3proxy doesn't free struct schedule.</p>
|
||||||
|
<p>Schedule list can be empty. Pointer to schedule is pointed by <code>struct schedule ** schedule;</code> in pluginlink.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre><code>int myschedfunc(void * data);
|
||||||
|
struct schedule myschedule;
|
||||||
|
|
||||||
|
myschedule.data = "somethinghere";
|
||||||
|
myschedule.function = myschedfunc;
|
||||||
|
myschedule.type = MINUTELY;
|
||||||
|
myschedule.starttime = 0;
|
||||||
|
myschedule.next = *pluginlink->schedule;
|
||||||
|
*pluginlink->schedule = myschedule;</code></pre>
|
||||||
|
<p><span class="s1">NOTE:</span> time_t is different for different compilers. Make sure to compile plugin and 3proxy with same compiler.</p>
|
||||||
|
</li>
|
||||||
|
<li>Filters API
|
||||||
|
<p>3proxy has filters API, you can use, to process client request and data flowing through proxy. It should be noted, that currently 3proxy doesn't provide filters with any useful data conversion, so, it's filter's task to find data in data flow. In case filter modifies some data, it's filter's task again to assure that everything's fine. If you know some filtering API like MILTER, you will find 3proxy filters very same.</p>
|
||||||
|
<pre><code>typedef enum {
|
||||||
|
PASS,
|
||||||
|
CONTINUE,
|
||||||
|
HANDLED,
|
||||||
|
REJECT,
|
||||||
|
REMOVE
|
||||||
|
} FILTER_ACTION;
|
||||||
|
|
||||||
|
typedef void* FILTER_OPEN(void * idata, struct srvparam * param);
|
||||||
|
typedef FILTER_ACTION FILTER_CLIENT(void *fo, struct clientparam * param, void** fc);
|
||||||
|
typedef FILTER_ACTION FILTER_BUFFER(void *fc, struct clientparam * param, unsigned char ** buf_p, int * bufsize_p, int offset, int * length_p);
|
||||||
|
typedef void FILTER_CLOSE(void *fo);
|
||||||
|
|
||||||
|
struct filter {
|
||||||
|
struct filter * next;
|
||||||
|
char * instance;
|
||||||
|
void * data;
|
||||||
|
FILTER_OPEN *filter_open;
|
||||||
|
FILTER_CLIENT *filter_client;
|
||||||
|
FILTER_BUFFER *filter_request;
|
||||||
|
FILTER_BUFFER *filter_header_cli;
|
||||||
|
FILTER_BUFFER *filter_header_srv;
|
||||||
|
FILTER_BUFFER *filter_data_cli;
|
||||||
|
FILTER_BUFFER *filter_data_srv;
|
||||||
|
FILTER_CLOSE *filter_clear;
|
||||||
|
FILTER_CLOSE *filter_close;
|
||||||
|
};</code></pre>
|
||||||
|
<p><code>char * instance</code> – is some instance identifier. You can use it to find required filter in the list. 3proxy itself doesn't use this field.</p>
|
||||||
|
<p><code>void * data</code> – this parameter is passed to filter_open function. The rest are filtering functions. Section 1 explains where and then each filter is called. data should not be NULL.</p>
|
||||||
|
<p><code>filter_open</code> must always be defined, if you want filter to be ever used. It's called then new service is created and is given "data" from struct filter and struct srvparam (parsed service configuration). If filter_open for some filter returns NULL, filter will not be used for this service. Non-NULL return value will be used as "fo" parameter for every call to filter_client.</p>
|
||||||
|
<p><code>filter_client</code> is called upon client connect (before any data is sent/received). It's good place to filter client by IP (and is not good place to filter it by hostname, because this operation takes a long time, 3proxy will not be able to accept new connection). fo is a data pointer received from filter_open, param – newly created clientparam structure, fc is return parameter filter_open must initialize, it will be used as an argument to FILTER_BUFFER functions. PASS return value means this filter will be used for this client request. CONTINUE says to install filters. On different values client connection is closed and no client thread is created.</p>
|
||||||
|
<p><code>filter_request, filter_header_cli, filter_header_srv, filter_data_cli, filter_data_srv</code> are used to process request and data received from client and server.</p>
|
||||||
|
<p><code>char ** buf_p</code> is a pointer to current buffer, <code>int * bufsize_p</code> is a pointer to it's size. In case you change some data and it doesn't fit to current buffer, you may allocate new buffer (with <code>pluginlink->myalloc</code>), copy data from old buffer, free old buffer (with <code>pluginlink->myfree</code>) and set new values for <code>*buf_p</code> and <code>*bufsize_p</code>.</p>
|
||||||
|
<p><code>int offset</code> offset of the new data in the buffer, <code>int * length_p</code> length of all data in the buffer. You should filter only <code>(*length_p - *offset_p)</code> characters starting from <code>(*buf_p + *offset_p)</code>.</p>
|
||||||
|
<p><code>filter_clear</code> is called for each successfule filter_client and should be used to free allocated resources</p>
|
||||||
|
<p><code>filter_close</code> is called for each successful filter_open for the same reason</p>
|
||||||
|
<p>An example of filter API usage you can find in PCREPlugin (see plugins/PCREPlugin/pcre_plugin.c).</p>
|
||||||
|
<p><span class="s1">Note</span>: if <code>param->nooverwritefilter</code> is set for FILTER_BUFFER functions, filter may change data in the buffer, but must not change data length. This flag may be set, if data size if already known and is sent to the client.</p>
|
||||||
|
</li>
|
||||||
|
<li>Replacing log functions, traffic counting functions, bandwidth limitation functions
|
||||||
|
<p>Log, traffic and bandwidth function can be directly replaced in any over place. All functions may be replaced in conf (<code>pluginlink->conf->logfunc</code>, <code>pluginlink->conf->bandlimfunc</code>, <code>pluginlink->conf->trafcountfunc</code>). In this case, these functions will be used for services started after the changes are made. logfunc may also be changed for struct srvparam (e.g. within filter_open), bandlimfunc and trafcountfunc may be changed in struct clientparam for every client individually (e.g. within filter_client).</p>
|
||||||
|
<pre><code>typedef void (*LOGFUNC)(struct clientparam * param, const unsigned char * test);
|
||||||
|
typedef void (*TRAFCOUNTFUNC)(struct clientparam * param);
|
||||||
|
typedef unsigned (*BANDLIMFUNC)(struct clientparam * param, unsigned nbytesin, unsigned nbytesout);</code></pre>
|
||||||
|
<p><code>struct clientparam * param</code> – information about client request</p>
|
||||||
|
<p><code>char * text</code> - text string (e.g. request)</p>
|
||||||
|
<p><code>nbytesin, nbytesout</code> – number of bytes received from / send to server. bandlimfunc returns delay in milliseconds.</p>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
<H2><A href="howtoe.html">See HowTo:</a></H2>
|
<H2><A href="howtoe.html">See HowTo:</a></h2>
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
<H2><A href="howtoe.html">См. HowTo</a></H2>
|
<H2><A href="howtoe.html">См. HowTo</a></h2>
|
||||||
+424
-57
@@ -5,8 +5,8 @@
|
|||||||
<h4>Configuring 'maxconn'</h4>
|
<h4>Configuring 'maxconn'</h4>
|
||||||
|
|
||||||
The number of simultaneous connections per service is limited by the 'maxconn' option.
|
The number of simultaneous connections per service is limited by the 'maxconn' option.
|
||||||
The default maxconn value since 3proxy 0.8 is 500. You may want to set 'maxconn'
|
The default maxconn value is 500. You may want to set 'maxconn'
|
||||||
to a higher value. Under this configuration:
|
to a higher value; it must be set before the services it should apply to. Under this configuration:
|
||||||
<pre>
|
<pre>
|
||||||
maxconn 1000
|
maxconn 1000
|
||||||
proxy -p3129
|
proxy -p3129
|
||||||
@@ -19,6 +19,10 @@ simultaneous connections to 3proxy.
|
|||||||
<p>Avoid setting 'maxconn' to an arbitrarily high value; it should be carefully
|
<p>Avoid setting 'maxconn' to an arbitrarily high value; it should be carefully
|
||||||
chosen to protect the system and proxy from resource exhaustion. Setting maxconn
|
chosen to protect the system and proxy from resource exhaustion. Setting maxconn
|
||||||
above available resources can lead to denial of service conditions.
|
above available resources can lead to denial of service conditions.
|
||||||
|
<p>'maxconn' is not reduced automatically to fit the open file limit. If the limit is
|
||||||
|
too low 3proxy only prints a warning at startup
|
||||||
|
("current open file ulimits are too low") and then fails to accept connections once
|
||||||
|
the limit is reached, so check for this warning after changing 'maxconn'.
|
||||||
<h4>Understanding Resource Requirements</h4>
|
<h4>Understanding Resource Requirements</h4>
|
||||||
Each running service requires:
|
Each running service requires:
|
||||||
<ul>
|
<ul>
|
||||||
@@ -30,10 +34,7 @@ Each connected client requires:
|
|||||||
<ul>
|
<ul>
|
||||||
<li>1 thread (process)
|
<li>1 thread (process)
|
||||||
<li>2 sockets (file descriptors). For FTP, 4 sockets are required.
|
<li>2 sockets (file descriptors). For FTP, 4 sockets are required.
|
||||||
<br>Under Linux since 0.9, splice() is used. It's much more efficient but requires
|
<br>Up to 128K of kernel buffer memory. This is the theoretical maximum; actual numbers depend on connection quality and traffic amount.
|
||||||
<br>2 sockets (file descriptors) + 2 pipes (file descriptors) = 4 file descriptors.
|
|
||||||
<br>For FTP with splice(), 4 sockets and 2 pipes are required.
|
|
||||||
<br>Up to 128K (up to 256K in the case of splice()) of kernel buffer memory. This is the theoretical maximum; actual numbers depend on connection quality and traffic amount.
|
|
||||||
<br>1 additional socket (file descriptor) during name resolution for non-cached names
|
<br>1 additional socket (file descriptor) during name resolution for non-cached names
|
||||||
<br>1 additional socket during authentication or logging for RADIUS authentication or logging.
|
<br>1 additional socket during authentication or logging for RADIUS authentication or logging.
|
||||||
<li>1 ephemeral port (3 ephemeral ports for FTP connections).
|
<li>1 ephemeral port (3 ephemeral ports for FTP connections).
|
||||||
@@ -59,19 +60,45 @@ system "ulimit -Sa >>/tmp/3proxy.ulim.soft"
|
|||||||
at the beginning (before the first service is started) and at the end of the config file.
|
at the beginning (before the first service is started) and at the end of the config file.
|
||||||
Perform both a hard restart (i.e., kill and start the 3proxy process) and a soft restart
|
Perform both a hard restart (i.e., kill and start the 3proxy process) and a soft restart
|
||||||
by sending SIGUSR1 to the 3proxy process; check that the ulimits recorded to files match your
|
by sending SIGUSR1 to the 3proxy process; check that the ulimits recorded to files match your
|
||||||
expectations. In systemd-based distros (e.g., latest Debian/Ubuntu), changing limits.conf
|
expectations. In systemd-based distros (e.g., latest Debian/Ubuntu) changing limits.conf is not
|
||||||
is not enough; limits must be adjusted in the systemd configuration, e.g., by setting:
|
enough for a service: limits must be set in the unit file. Set them in the 3proxy
|
||||||
|
unit itself rather than globally, so the rest of the system is unaffected. The
|
||||||
|
shipped 3proxy.service already contains:
|
||||||
<pre>
|
<pre>
|
||||||
DefaultLimitDATA=infinity
|
LimitNOFILE=1048576
|
||||||
DefaultLimitSTACK=infinity
|
LimitNPROC=infinity
|
||||||
DefaultLimitCORE=infinity
|
TasksMax=infinity
|
||||||
DefaultLimitRSS=infinity
|
</pre>
|
||||||
DefaultLimitNOFILE=102400
|
To change them on an installed system use an override instead of editing the unit:
|
||||||
DefaultLimitAS=infinity
|
<pre>
|
||||||
DefaultLimitNPROC=10240
|
systemctl edit 3proxy
|
||||||
DefaultLimitMEMLOCK=infinity
|
systemctl daemon-reload && systemctl restart 3proxy
|
||||||
|
systemctl show 3proxy -p LimitNOFILE -p LimitNPROC -p TasksMax
|
||||||
|
</pre>
|
||||||
|
<b>TasksMax is the one that is easy to miss.</b> It is the cgroup limit on the number
|
||||||
|
of threads, and if it is not set the unit inherits DefaultTasksMax, which is 15% of
|
||||||
|
kernel.threads-max (about 9000 on a typical host). Since 3proxy uses one thread per
|
||||||
|
connection, that caps concurrent connections at that number regardless of LimitNPROC
|
||||||
|
and maxconn, and the only symptom is "pthread_create()" errors in the log.
|
||||||
|
<p>On systemd older than 227, which has no TasksMax, and for limits that must apply to
|
||||||
|
several services, the same values can be set globally as DefaultLimitNOFILE /
|
||||||
|
DefaultLimitNPROC in /etc/systemd/system.conf, but prefer the per-unit settings.
|
||||||
|
|
||||||
|
<p>With SysV init the limits are not applied by limits.conf either, because
|
||||||
|
start-stop-daemon does not open a PAM session, so the daemon simply inherits the limits
|
||||||
|
of init. The shipped init script raises them itself before starting 3proxy:
|
||||||
|
<pre>
|
||||||
|
ulimit -n 65536
|
||||||
|
ulimit -u 32768
|
||||||
|
</pre>
|
||||||
|
adjust these values in the script to match 'maxconn'.
|
||||||
|
|
||||||
|
<p>On FreeBSD rc.subr applies limits(1) with the login class of the service (the
|
||||||
|
"daemon" class by default), so the limits can be set either in /etc/login.conf for that
|
||||||
|
class, or per service in rc.conf:
|
||||||
|
<pre>
|
||||||
|
3proxy_limits="-n 65536"
|
||||||
</pre>
|
</pre>
|
||||||
in user.conf / system.conf
|
|
||||||
|
|
||||||
<h4>Extending System Limitations</h4>
|
<h4>Extending System Limitations</h4>
|
||||||
|
|
||||||
@@ -86,19 +113,172 @@ proxy -olSO_REUSEADDR,SO_REUSEPORT -ocTCP_TIMESTAMPS,TCP_NODELAY -osTCP_NODELAY
|
|||||||
</pre>
|
</pre>
|
||||||
Available options are system-dependent.
|
Available options are system-dependent.
|
||||||
|
|
||||||
|
<h4>Linux Tuning Hints</h4>
|
||||||
|
|
||||||
|
Values below are examples, not recommendations: check the current value first
|
||||||
|
(<tt>sysctl NAME</tt>), change only what your workload actually hits, and make changes
|
||||||
|
persistent in <tt>/etc/sysctl.d/</tt>. Defaults given in parentheses are from a recent
|
||||||
|
(6.x) kernel and vary between distributions and versions.
|
||||||
|
|
||||||
|
<p><b>File descriptors.</b> 3proxy needs 2 descriptors per connection (4 for FTP), plus
|
||||||
|
one per service, plus temporary ones for name resolution and RADIUS.
|
||||||
|
<pre>
|
||||||
|
fs.nr_open = 1048576 # (1048576) upper bound for any process' RLIMIT_NOFILE
|
||||||
|
</pre>
|
||||||
|
<tt>ulimit -n</tt> (RLIMIT_NOFILE) is the limit that actually applies and is commonly
|
||||||
|
left at 1024; it must be raised for the 3proxy process itself, see "Setting ulimits"
|
||||||
|
above. <tt>fs.file-max</tt> is effectively unlimited on 64-bit kernels and rarely needs
|
||||||
|
changing.
|
||||||
|
|
||||||
|
<p><b>Threads.</b> Because of the "one connection - one thread" model these limits are
|
||||||
|
reached earlier with 3proxy than with event-driven servers. Each thread also consumes
|
||||||
|
one or two mappings, so <tt>vm.max_map_count</tt> matters too.
|
||||||
|
<pre>
|
||||||
|
kernel.threads-max = 200000 # (~60000 on a 16G host, scales with RAM)
|
||||||
|
kernel.pid_max = 4194304 # (4194304)
|
||||||
|
vm.max_map_count = 1048576 # (1048576)
|
||||||
|
</pre>
|
||||||
|
RLIMIT_NPROC (<tt>ulimit -u</tt>) limits threads per user and must be raised as well.
|
||||||
|
Check the actual thread count with <tt>grep Threads /proc/PID/status</tt>.
|
||||||
|
|
||||||
|
<p><b>Listen queue.</b> 3proxy uses a listen backlog of 1+(maxconn/8) unless the
|
||||||
|
'backlog' command is given, so a large 'maxconn' does not automatically give a large
|
||||||
|
queue, and the kernel caps it at somaxconn:
|
||||||
|
<pre>
|
||||||
|
net.core.somaxconn = 4096 # (4096)
|
||||||
|
net.ipv4.tcp_max_syn_backlog = 4096 # (512) raise for bursty connection rates
|
||||||
|
net.ipv4.tcp_syncookies = 1 # (1) keep enabled
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p><b>Ephemeral ports and TIME_WAIT.</b> See "Extending the Ephemeral Port Range" above
|
||||||
|
for the multi-IP case. The range gives about 28000 outgoing connections per
|
||||||
|
destination address by default:
|
||||||
|
<pre>
|
||||||
|
net.ipv4.ip_local_port_range = 10240 65535 # (32768 60999)
|
||||||
|
net.ipv4.tcp_tw_reuse = 2 # (2) reuse TIME_WAIT for outgoing connections
|
||||||
|
net.ipv4.tcp_fin_timeout = 30 # (60)
|
||||||
|
</pre>
|
||||||
|
Do not enable tcp_tw_recycle; it was removed in kernel 4.12 and breaks NAT clients.
|
||||||
|
|
||||||
|
<p><b>Socket buffers.</b> Autotuning is usually right. Buffer memory is per connection,
|
||||||
|
so raising the maximums with tens of thousands of connections costs a lot of RAM:
|
||||||
|
<pre>
|
||||||
|
net.core.rmem_max = 4194304 # (212992)
|
||||||
|
net.core.wmem_max = 4194304 # (212992)
|
||||||
|
net.ipv4.tcp_rmem = 4096 131072 6291456 # (same) min default max
|
||||||
|
net.ipv4.tcp_wmem = 4096 16384 4194304 # (same)
|
||||||
|
</pre>
|
||||||
|
Raise these only for high bandwidth-delay product links, and prefer raising the third
|
||||||
|
(max) value and leaving the default alone.
|
||||||
|
|
||||||
|
<p><b>Conntrack.</b> Only relevant if netfilter/nftables tracks the proxy's traffic. If
|
||||||
|
it does, the table is exhausted long before 3proxy's own limits, with
|
||||||
|
"nf_conntrack: table full, dropping packet" in dmesg:
|
||||||
|
<pre>
|
||||||
|
net.netfilter.nf_conntrack_max = 1048576
|
||||||
|
net.netfilter.nf_conntrack_buckets = 262144
|
||||||
|
net.netfilter.nf_conntrack_tcp_timeout_established = 3600 # (432000, i.e. 5 days)
|
||||||
|
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 30 # (120)
|
||||||
|
</pre>
|
||||||
|
nf_conntrack_max defaults to nf_conntrack_buckets, which itself is derived from the
|
||||||
|
amount of RAM, so it is often much lower than expected on small machines. Each
|
||||||
|
connection takes two entries (one per direction). The default established timeout of
|
||||||
|
5 days matters more than the table size with high connection churn: entries for
|
||||||
|
connections that are long gone keep occupying the table.
|
||||||
|
<p>If no rules need conntrack, not loading it at all is faster: the modules are loaded
|
||||||
|
on demand by the first rule that needs them ("-m state", "-m conntrack", any NAT
|
||||||
|
rule), so a ruleset without such rules keeps the proxy traffic untracked. If conntrack
|
||||||
|
is needed for other traffic but not for the proxy's, exempt the proxy's traffic
|
||||||
|
explicitly in the raw table:
|
||||||
|
<pre>
|
||||||
|
iptables -t raw -A PREROUTING -p tcp --dport 3128 -j CT --notrack
|
||||||
|
iptables -t raw -A OUTPUT -p tcp -m owner --uid-owner proxy -j CT --notrack
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p><b>Conntrack helpers (ALGs).</b> The helper modules - nf_conntrack_ftp,
|
||||||
|
nf_conntrack_sip, nf_conntrack_h323, nf_conntrack_pptp, nf_conntrack_irc,
|
||||||
|
nf_conntrack_tftp - inspect the payload of every matching packet and create additional
|
||||||
|
"expectation" entries, so they cost both CPU and table space, and they have a long
|
||||||
|
history of security issues. Unload and blacklist the ones you do not actually need:
|
||||||
|
<pre>
|
||||||
|
lsmod | grep nf_conntrack
|
||||||
|
modprobe -r nf_conntrack_sip nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_pptp
|
||||||
|
echo "blacklist nf_conntrack_sip" >> /etc/modprobe.d/no-alg.conf
|
||||||
|
</pre>
|
||||||
|
On current kernels a helper only acts when it is attached explicitly
|
||||||
|
("-j CT --helper ftp"), so simply not attaching it is enough; automatic helper
|
||||||
|
assignment was deprecated and later removed. Older kernels, and most router firmware,
|
||||||
|
still enable them by default.
|
||||||
|
|
||||||
|
<p><b>Checking the result.</b> <tt>ss -s</tt> for socket state totals,
|
||||||
|
<tt>ss -lnt</tt> for listen queue overflow, <tt>nstat -az TcpExtListenOverflows
|
||||||
|
TcpExtListenDrops</tt> for accept queue drops, and
|
||||||
|
<tt>cat /proc/PID/limits</tt> for the limits actually applied to the running process.
|
||||||
|
|
||||||
|
<h4>Windows Tuning Hints</h4>
|
||||||
|
|
||||||
|
<p><b>Dynamic (ephemeral) port range.</b> Since Windows Vista / Server 2008 the default
|
||||||
|
range is 49152-65535, i.e. only 16384 outgoing connections per local address, which is
|
||||||
|
reached quickly by a busy proxy. Show and change it with:
|
||||||
|
<pre>
|
||||||
|
netsh int ipv4 show dynamicport tcp
|
||||||
|
netsh int ipv4 set dynamicport tcp start=10000 num=55535
|
||||||
|
</pre>
|
||||||
|
The minimum start port is 1025, the minimum size of the range is 255, and the end of
|
||||||
|
the range cannot exceed 65535. The range is set separately for TCP and UDP, and for
|
||||||
|
IPv4 and IPv6. On pre-Vista systems the equivalent is the MaxUserPort registry value
|
||||||
|
in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
|
||||||
|
|
||||||
|
<p><b>Listening socket.</b> 3proxy sets SO_REUSEADDR on the listening socket by
|
||||||
|
default on Unix, but not on Windows: there it is not needed to rebind the port, and it
|
||||||
|
only allows another local process to bind the same address and port, with undefined
|
||||||
|
behaviour as to which of them receives the connections. If the machine is shared or
|
||||||
|
untrusted, harden the listening socket instead:
|
||||||
|
<pre>
|
||||||
|
proxy -olSO_EXCLUSIVEADDRUSE
|
||||||
|
</pre>
|
||||||
|
Note that a socket with SO_EXCLUSIVEADDRUSE may not be immediately rebindable after a
|
||||||
|
restart if accepted connections are still active, so test restarts before using it.
|
||||||
|
|
||||||
|
<p><b>Port reuse.</b> 3proxy always binds the outgoing socket before connecting, so
|
||||||
|
Windows does not apply its automatic ephemeral port reuse (which it does only for
|
||||||
|
connections with an implicit bind). Setting the option explicitly on the
|
||||||
|
proxy-to-server socket therefore helps against port exhaustion:
|
||||||
|
<pre>
|
||||||
|
proxy -osSO_REUSE_UNICASTPORT
|
||||||
|
</pre>
|
||||||
|
SO_REUSE_UNICASTPORT requires Windows 10 / Server 2019 or later. On older systems
|
||||||
|
(Windows 7 / Server 2008 and later) use SO_PORT_SCALABILITY instead; where both are
|
||||||
|
available Microsoft recommends SO_REUSE_UNICASTPORT. Note that SO_REUSEADDR has
|
||||||
|
different, weaker semantics on Windows than on Unix and allows another socket to bind
|
||||||
|
the same address and port, so do not use it on the listening socket as a substitute.
|
||||||
|
|
||||||
|
<p><b>TIME_WAIT.</b> Closed connections hold their port for the TcpTimedWaitDelay
|
||||||
|
period, set in
|
||||||
|
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters (DWORD, seconds). The
|
||||||
|
effective default differs between Windows versions (2 to 4 minutes); check the current
|
||||||
|
behaviour before changing it, and lower it only together with an extended port range.
|
||||||
|
Count the connections in that state with:
|
||||||
|
<pre>
|
||||||
|
netstat -ano -p tcp | find /c "TIME_WAIT"
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p><b>Threads and address space.</b> Windows has no ulimit equivalent, and the handle
|
||||||
|
count is not normally the limit. On 32-bit builds the 2 GB of user address space is:
|
||||||
|
each connection thread reserves its stack there, so a few thousand connections can
|
||||||
|
exhaust the address space while physical memory is still free. Use a 64-bit build for high load, and
|
||||||
|
see "Setting Stack Size" above.
|
||||||
|
|
||||||
|
<p><b>Filter drivers.</b> Antivirus, endpoint protection and other LSP/WFP filter
|
||||||
|
drivers inspect every connection and are frequently the actual bottleneck on Windows,
|
||||||
|
costing far more than any tuning above can recover. Exclude the 3proxy process and its
|
||||||
|
ports, or test with the protection temporarily disabled to see the difference before
|
||||||
|
tuning anything else.
|
||||||
|
|
||||||
<h4>Using 3proxy in a Virtual Environment</h4>
|
<h4>Using 3proxy in a Virtual Environment</h4>
|
||||||
|
|
||||||
If 3proxy is used in a VPS environment, there can be additional limitations.
|
If 3proxy is used in a VPS environment, there can be additional limitations.
|
||||||
For example, kernel resources, system CPU usage, and IOCTLs can be limited differently, and this can become a bottleneck.
|
For example, kernel resources, system CPU usage, and IOCTLs can be limited differently, and this can become a bottleneck.
|
||||||
Since 0.9-devel, 3proxy uses splice() by default on Linux. splice() prevents network traffic from being copied from
|
|
||||||
kernel space to the 3proxy process and generally increases throughput, especially in the case of high-volume traffic. This is especially
|
|
||||||
true for virtual environments (it can improve throughput up to 10 times) unless there are additional kernel limitations.
|
|
||||||
Since some work is moved to the kernel, it requires up to 2 times more kernel resources in terms of CPU, memory, and IOCTLs.
|
|
||||||
If your hosting additionally limits kernel resources (you can see this as nearly 100% CPU usage without any real CPU activity for
|
|
||||||
any application performing IOCTLs), use the -s0 option to disable splice() usage for a given service, e.g.:
|
|
||||||
<pre>
|
|
||||||
socks -s0
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h4>Extending the Ephemeral Port Range</h4>
|
<h4>Extending the Ephemeral Port Range</h4>
|
||||||
|
|
||||||
@@ -160,10 +340,10 @@ Under the latest Linux versions, you can also start multiple services with diffe
|
|||||||
external addresses on a single port with SO_REUSEPORT on the listening socket to
|
external addresses on a single port with SO_REUSEPORT on the listening socket to
|
||||||
evenly distribute incoming connections between outgoing interfaces:
|
evenly distribute incoming connections between outgoing interfaces:
|
||||||
<pre>
|
<pre>
|
||||||
socks -olSO_REUSEPORT -p3128 -e 1.1.1.1
|
socks -olSO_REUSEPORT -p3128 -e1.1.1.1
|
||||||
socks -olSO_REUSEPORT -p3128 -e 2.2.2.2
|
socks -olSO_REUSEPORT -p3128 -e2.2.2.2
|
||||||
socks -olSO_REUSEPORT -p3128 -e 3.3.3.3
|
socks -olSO_REUSEPORT -p3128 -e3.3.3.3
|
||||||
socks -olSO_REUSEPORT -p3128 -e 4.4.4.4
|
socks -olSO_REUSEPORT -p3128 -e4.4.4.4
|
||||||
</pre>
|
</pre>
|
||||||
For web browsing, the last two examples are not recommended because the same client can get
|
For web browsing, the last two examples are not recommended because the same client can get
|
||||||
a different external address for different requests; you should choose the external
|
a different external address for different requests; you should choose the external
|
||||||
@@ -184,6 +364,39 @@ randomly fail due to IP+port pair collisions if the remote or local system
|
|||||||
doesn't support this trick.
|
doesn't support this trick.
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
<h4>NAT on the Path Must Be Tuned Too</h4>
|
||||||
|
|
||||||
|
Everything above tunes the machine 3proxy runs on. If the outgoing traffic passes
|
||||||
|
through NAT - a router, a firewall, a CGNAT of the provider, or a cloud NAT gateway -
|
||||||
|
that device keeps its own translation table and its own pool of source ports, and it
|
||||||
|
limits the number of connections independently of the proxy. Extending
|
||||||
|
ip_local_port_range on the 3proxy host changes nothing if the NAT device rewrites the
|
||||||
|
source port from its own, smaller pool.
|
||||||
|
|
||||||
|
<p>On a Linux based router the same knobs apply and have to be raised there as well:
|
||||||
|
nf_conntrack_max / nf_conntrack_buckets and the conntrack timeouts (see "Linux Tuning
|
||||||
|
Hints" above), plus the port range used for translation, which is ip_local_port_range
|
||||||
|
for MASQUERADE, or the explicit range if SNAT is configured with --to-ports. Note that
|
||||||
|
the range is per translated address: with a single public IP, all clients share it.
|
||||||
|
|
||||||
|
<p>Entry level and SOHO routers are the usual bottleneck here. They typically have a
|
||||||
|
small fixed NAT/conntrack table (a few thousand entries), aggressive or non-adjustable
|
||||||
|
timeouts, and no way to change either. Symptoms are seen on the proxy but caused by the
|
||||||
|
router: connections that fail or hang at random under load while the proxy is far from
|
||||||
|
its own limits, no error in the 3proxy log except a failed outgoing connect, and
|
||||||
|
recovery after a pause or a router reboot. Before tuning 3proxy further, check the
|
||||||
|
router's session/NAT table counters. For high load either give the proxy a public
|
||||||
|
address without NAT in the path, or use a router where the table size and timeouts are
|
||||||
|
configurable.
|
||||||
|
|
||||||
|
<p>On the router, also turn off the application layer gateways that are not actually
|
||||||
|
used - they usually appear in the web interface as "SIP ALG", "FTP ALG", "H.323 ALG",
|
||||||
|
"PPTP passthrough", "IPsec/VPN passthrough". They are commonly enabled by default, they
|
||||||
|
parse the payload of matching connections, and they consume additional session table
|
||||||
|
entries for the connections they expect. If nothing behind the proxy uses FTP, VoIP or
|
||||||
|
those VPN protocols, disabling them frees table space and CPU on exactly the device
|
||||||
|
that is the bottleneck.
|
||||||
|
|
||||||
<h4>Setting Stack Size</h4>
|
<h4>Setting Stack Size</h4>
|
||||||
|
|
||||||
'stacksize' is a size added to all stack allocations and can be both positive and
|
'stacksize' is a size added to all stack allocations and can be both positive and
|
||||||
@@ -199,7 +412,11 @@ the need to add additional physical memory,
|
|||||||
but it's system/libc dependent and requires additional testing under your
|
but it's system/libc dependent and requires additional testing under your
|
||||||
installation. Don't forget about memory-related ulimits.
|
installation. Don't forget about memory-related ulimits.
|
||||||
<p>For 32-bit systems, address space can be a bottleneck you should consider. If
|
<p>For 32-bit systems, address space can be a bottleneck you should consider. If
|
||||||
you're short on address space, you can try using a negative stack size.
|
you're short on address space, you can try using a negative stack size. The result is
|
||||||
|
never lowered below the system minimum (PTHREAD_STACK_MIN), so a large negative value
|
||||||
|
can not disable the thread stack. The base value the 'stacksize' is added to is 48K
|
||||||
|
(64K on FreeBSD/NetBSD/OpenBSD/DragonFly, where libc uses more stack, e.g. in
|
||||||
|
vfprintf() called by syslog()).
|
||||||
|
|
||||||
<h4>Known System Issues</h4>
|
<h4>Known System Issues</h4>
|
||||||
|
|
||||||
@@ -211,13 +428,181 @@ use 3proxy's built-in resolver (nserver / nscache / nscache6).
|
|||||||
Public resolvers like those from Google have rate limits. For a large number of
|
Public resolvers like those from Google have rate limits. For a large number of
|
||||||
requests, install a local caching recursor (ISC bind named, PowerDNS recursor, etc).
|
requests, install a local caching recursor (ISC bind named, PowerDNS recursor, etc).
|
||||||
|
|
||||||
<h4>Avoid Large Lists</h4>
|
<h4>Use the Authentication Cache</h4>
|
||||||
|
|
||||||
Currently, 3proxy is not optimized to use large ACLs, user lists, etc. All lists
|
Authentication and authorization are performed for every request. Password
|
||||||
are processed linearly. In the devel version, you can use RADIUS authentication to avoid
|
lookup itself is a hash lookup and is cheap, but the ACL is walked linearly,
|
||||||
user lists and ACLs in 3proxy itself. Also, RADIUS allows you to easily set an outgoing IP
|
and with RADIUS or plugin authentication every request costs a network round
|
||||||
on a per-user basis or implement more sophisticated logic.
|
trip. 'authcache' keeps the result of a successful authentication for a number
|
||||||
RADIUS is a new beta feature; test it before using it in production.
|
of seconds:
|
||||||
|
<pre>
|
||||||
|
authcache <cachetype> <cachetime> <cachesize>
|
||||||
|
</pre>
|
||||||
|
'cachetype' lists the fields the entry is keyed by, 'cachetime' is the lifetime
|
||||||
|
in seconds, and the optional 'cachesize' limits the number of entries. The
|
||||||
|
cached type must be placed before the real authentication type in the 'auth'
|
||||||
|
command: a cache miss falls through to the next type in the chain, and a hit
|
||||||
|
skips it.
|
||||||
|
|
||||||
|
<p>There are two cached types:
|
||||||
|
<ul>
|
||||||
|
<li>'cache' caches the authentication only; the ACL is still checked on every
|
||||||
|
request. Use it when ACLs must take effect immediately, or when the
|
||||||
|
authentication method returns per-user parameters that the authorization step
|
||||||
|
has to apply.
|
||||||
|
<li>'cacheacl' also caches the authorization result, so the ACL is not walked
|
||||||
|
at all on a hit. This is the one that helps with long ACLs, but the key must
|
||||||
|
cover every field the ACL limits, and it can not be used with redirections.
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p><b>'cacheacl' does not work with parent proxies.</b> Redirections are applied
|
||||||
|
while the ACL is walked, so on a 'cacheacl' hit no redirection happens at all:
|
||||||
|
the request is sent directly instead of through the 'parent' proxy of the
|
||||||
|
matching ACL entry, and nothing is reported. The first request for a given key
|
||||||
|
uses the parent and the rest do not, which makes it look intermittent. Use
|
||||||
|
'cache' with parent proxies:
|
||||||
|
<pre>
|
||||||
|
authcache user,pass 60
|
||||||
|
auth cache strong
|
||||||
|
allow user1
|
||||||
|
parent 1000 socks5 10.0.0.1 1080
|
||||||
|
proxy
|
||||||
|
</pre>
|
||||||
|
The one exception is 'parent ... extip': the external address is stored in the
|
||||||
|
cache entry and restored on a hit, but only if 'ext' is a part of the key:
|
||||||
|
<pre>
|
||||||
|
authcache user,pass,ext 60
|
||||||
|
auth cacheacl strong
|
||||||
|
allow user1
|
||||||
|
parent 1000 extip 1.2.3.4 0
|
||||||
|
proxy
|
||||||
|
</pre>
|
||||||
|
Without 'ext' in the key the external address falls back to the default one on
|
||||||
|
every cache hit.
|
||||||
|
|
||||||
|
<p><b>The key must match the ACL.</b> On a 'cacheacl' hit the cached result is
|
||||||
|
reused as is, so any field the ACL limits but the key does not contain makes
|
||||||
|
the cached result apply to a request it was not computed for. Use 'user' and
|
||||||
|
'pass' for the userlist, 'ip' for the sourcelist, 'dstaddr' and 'dsthost' for
|
||||||
|
the targetlist, 'dstport' for the targetportlist and 'dstoper' for the
|
||||||
|
operationlist. For this ACL:
|
||||||
|
<pre>
|
||||||
|
allow user1,user2 * * 80,443
|
||||||
|
deny *
|
||||||
|
</pre>
|
||||||
|
the key needs 'user', 'pass' and 'dstport':
|
||||||
|
<pre>
|
||||||
|
users $/etc/3proxy/passwd
|
||||||
|
authcache user,pass,dstport 60 65536
|
||||||
|
auth cacheacl strong
|
||||||
|
allow user1,user2 * * 80,443
|
||||||
|
deny *
|
||||||
|
proxy
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>With RADIUS the round trip is the expensive part, so cache by whatever
|
||||||
|
identifies the client:
|
||||||
|
<pre>
|
||||||
|
radius secret 1.2.3.4
|
||||||
|
authcache ip,user,pass 600
|
||||||
|
auth cache radius
|
||||||
|
proxy
|
||||||
|
</pre>
|
||||||
|
'cache' rather than 'cacheacl' is used here because RADIUS may return per-user
|
||||||
|
parameters such as the outgoing IP; add 'ext' to the key to cache the external
|
||||||
|
address returned by RADIUS as well.
|
||||||
|
|
||||||
|
<p>Choose 'cachetime' to balance the load against how quickly a password or ACL
|
||||||
|
change has to take effect. Cache entries are <b>not</b> invalidated by a
|
||||||
|
configuration reload, so a long lifetime keeps applying the old decision to
|
||||||
|
existing keys after the new configuration is loaded.
|
||||||
|
|
||||||
|
<p>Note that 'ip' alone, or 'ip,user' without 'pass', assigns every connection
|
||||||
|
from the same address to the same user for the lifetime of the entry without
|
||||||
|
checking the password. That is a deliberate trade-off for high load; do not use
|
||||||
|
it where clients share addresses.
|
||||||
|
|
||||||
|
<h4>Tune UDP Destination Handling with '-U'</h4>
|
||||||
|
|
||||||
|
Within a SOCKSv5 UDP association the destination is taken from every datagram,
|
||||||
|
so 3proxy authorizes and logs every new destination. One association can reach
|
||||||
|
any number of destinations: a DNS forwarder produces one record, but a
|
||||||
|
peer-to-peer or QUIC client can produce hundreds, each costing an authorization
|
||||||
|
(a network round trip with RADIUS or plugin authentication) and a log record.
|
||||||
|
The 'socks' service option '-U' controls this:
|
||||||
|
<pre>
|
||||||
|
socks -U3 # default: log and authorize every new destination
|
||||||
|
socks -U2 # authorize, do not log
|
||||||
|
socks -U1 # log, do not authorize
|
||||||
|
socks -U0 # neither (same as bare -U)
|
||||||
|
</pre>
|
||||||
|
The destination of the first datagram is always authorized and logged, so the
|
||||||
|
association as a whole is still subject to ACLs, authentication and the choice
|
||||||
|
of the parent proxy.
|
||||||
|
|
||||||
|
<p>Before reaching for the option, note that the cost is already avoided when no
|
||||||
|
ACL entry reachable by the client limits the destination: in that case the
|
||||||
|
result can not depend on the destination and no re-authorization is performed
|
||||||
|
whatever '-U' says. '-U' only matters for configurations that do limit the
|
||||||
|
destination.
|
||||||
|
|
||||||
|
<p>For high load:
|
||||||
|
<ul>
|
||||||
|
<li><b>'-U2'</b> is the safe one. Destination ACLs keep working, only the
|
||||||
|
per-destination log records are dropped. Use it when log volume, not CPU, is
|
||||||
|
the problem.
|
||||||
|
<li><b>'-U' ('-U0')</b> removes both costs and is the fastest, but destination
|
||||||
|
ACLs then apply only to the first destination of each association, and the
|
||||||
|
parent proxy and external address chosen for it are kept for the whole
|
||||||
|
association. Use it when UDP destinations are not restricted anyway, or when
|
||||||
|
the restriction is enforced elsewhere (a firewall, or the parent proxy).
|
||||||
|
<li>Keep the default '-U3' when destination ACLs are a security boundary, and
|
||||||
|
make the authorization itself cheap with 'authcache' instead, see "Use the
|
||||||
|
Authentication Cache" above.
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h4>Avoid Large ACLs</h4>
|
||||||
|
|
||||||
|
Most of the large data structures are hash tables and scale to a large number of
|
||||||
|
records: the user list loaded by 'users' (including the '$/path/to/file' form),
|
||||||
|
the authentication cache ('authcache'), the DNS cache ('nscache'/'nscache6') and
|
||||||
|
the client table of the UDP portmapper. Their size is not a concern.
|
||||||
|
|
||||||
|
<p>The ACL is the exception and is still processed linearly. Every request walks
|
||||||
|
the access list entry by entry until one matches, and within an entry the
|
||||||
|
userlist, the sourcelist, the targetlist and the targetportlist are walked
|
||||||
|
linearly as well, so the cost is roughly the number of entries multiplied by the
|
||||||
|
size of the lists inside them. The 'bandlimin'/'bandlimout' and
|
||||||
|
'countin'/'countout' rules are separate lists of the same kind and are walked on
|
||||||
|
every request in addition to the access list.
|
||||||
|
|
||||||
|
<p>Two things follow from this:
|
||||||
|
<ul>
|
||||||
|
<li>Order matters. The walk stops at the first matching entry, so put the
|
||||||
|
entries that match most of the traffic first.
|
||||||
|
<li>Prefer fewer, wider entries over many narrow ones. One entry with a long
|
||||||
|
userlist is cheaper than one entry per user, because the outer walk is repeated
|
||||||
|
for every entry while the inner list is only walked for entries that got that
|
||||||
|
far.
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>With a large ACL, cache the authorization result instead of shortening the
|
||||||
|
list. 'cacheacl' walks the ACL once per cache entry rather than once per
|
||||||
|
request:
|
||||||
|
<pre>
|
||||||
|
users $/etc/3proxy/passwd
|
||||||
|
authcache user,pass,dstaddr,dstport 60 65536
|
||||||
|
auth cacheacl strong
|
||||||
|
</pre>
|
||||||
|
Both limitations from "Use the Authentication Cache" above apply: the cache key
|
||||||
|
must contain every field the ACL limits, and 'cacheacl' must not be used
|
||||||
|
together with parent proxies. Where a parent proxy is required, plain 'cache'
|
||||||
|
still removes the authentication cost but leaves the ACL walk on every request.
|
||||||
|
|
||||||
|
<p>RADIUS moves the user list and the ACLs out of 3proxy entirely, and also
|
||||||
|
allows you to set an outgoing IP on a per-user basis or to implement more
|
||||||
|
sophisticated logic. RADIUS is a new beta feature; test it before using it in
|
||||||
|
production.
|
||||||
|
|
||||||
<h4>Avoid Changing Configuration Too Often</h4>
|
<h4>Avoid Changing Configuration Too Often</h4>
|
||||||
|
|
||||||
@@ -268,24 +653,6 @@ sets TCP_NODELAY for client (oc) and server (os) connections.
|
|||||||
<p>Do not use TCP_NODELAY on slow connections with high delays when
|
<p>Do not use TCP_NODELAY on slow connections with high delays when
|
||||||
connection bandwidth is a bottleneck.
|
connection bandwidth is a bottleneck.
|
||||||
|
|
||||||
<h4>Use Splice to Speed Up Large Data Amount Transfers</h4>
|
|
||||||
|
|
||||||
splice() allows copying data between connections without copying to the process
|
|
||||||
address space. It can speed up the proxy on high-bandwidth connections if most
|
|
||||||
connections require large data transfers. Splice is enabled by default on Linux
|
|
||||||
since 0.9; "-s0" disables splice usage. Example:
|
|
||||||
<pre>
|
|
||||||
proxy -s0
|
|
||||||
</pre>
|
|
||||||
Splice is only available on Linux. Splice requires more system buffers and file descriptors
|
|
||||||
and produces more IOCTLs but reduces process memory and overall CPU usage.
|
|
||||||
Disable splice if there are a lot of short-lived connections with no bandwidth
|
|
||||||
requirements.
|
|
||||||
<p>Use splice only on high-speed connections (e.g., 10GbE) when the processor, memory speed, or
|
|
||||||
system bus are bottlenecks.
|
|
||||||
<p>TCP_NODELAY and splice are not contrary to each other and should be combined on
|
|
||||||
high-speed connections.
|
|
||||||
|
|
||||||
<h4>Add Grace Delay to Reduce System Calls</h4>
|
<h4>Add Grace Delay to Reduce System Calls</h4>
|
||||||
|
|
||||||
<pre>proxy -g8000,3,10</pre>
|
<pre>proxy -g8000,3,10</pre>
|
||||||
@@ -294,7 +661,7 @@ the minimal number of packets in the same direction to apply the algorithm,
|
|||||||
and the last value is the delay added after polling and prior to reading data.
|
and the last value is the delay added after polling and prior to reading data.
|
||||||
The example above adds a 10-millisecond delay before reading data if the average
|
The example above adds a 10-millisecond delay before reading data if the average
|
||||||
polling size is below 8000 bytes and 3 read operations have been made in the same
|
polling size is below 8000 bytes and 3 read operations have been made in the same
|
||||||
direction. It's especially useful with splice. <pre>logdump 1 1</pre> is useful
|
direction. <pre>logdump 1 1</pre> is useful
|
||||||
to see how grace delays work; choose a delay value to avoid filling the read
|
to see how grace delays work; choose a delay value to avoid filling the read
|
||||||
pipe/buffer (typically 64K) but keep the request sizes close to the chosen average
|
buffer (typically 64K) but keep the request sizes close to the chosen average
|
||||||
on large file uploads/downloads.
|
on large file uploads/downloads.
|
||||||
+692
-396
File diff suppressed because it is too large.
Load diff
+1357
-1054
File diff suppressed because it is too large.
Load diff
+4
-1
@@ -3,9 +3,12 @@
|
|||||||
<a href="highload.html">Optimizing 3proxy for high loads</a><br>
|
<a href="highload.html">Optimizing 3proxy for high loads</a><br>
|
||||||
<a href="howtoe.html">How To (English, very incomplete)</a><br>
|
<a href="howtoe.html">How To (English, very incomplete)</a><br>
|
||||||
<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>
|
||||||
<h3>Man pages:</h3>
|
<h3>Man pages:</h3>
|
||||||
|
<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/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/pop3p.8.html">pop3p.8</A>
|
<br><A HREF="man8/pop3p.8.html">pop3p.8</A>
|
||||||
<br><A HREF="man8/proxy.8.html">proxy.8</A>
|
<br><A HREF="man8/proxy.8.html">proxy.8</A>
|
||||||
<br><A HREF="man8/smtpp.8.html">smtpp.8</A>
|
<br><A HREF="man8/smtpp.8.html">smtpp.8</A>
|
||||||
@@ -13,5 +16,5 @@
|
|||||||
<br><A HREF="man8/tcppm.8.html">tcppm.8</A>
|
<br><A HREF="man8/tcppm.8.html">tcppm.8</A>
|
||||||
<br><A HREF="man8/tlspr.8.html">tlspr.8</A>
|
<br><A HREF="man8/tlspr.8.html">tlspr.8</A>
|
||||||
<br><A HREF="man8/udppm.8.html">udppm.8</A>
|
<br><A HREF="man8/udppm.8.html">udppm.8</A>
|
||||||
<br><A HREF="man3/3proxy.cfg.3.html">3proxy.cfg.3</A>
|
<br><A HREF="man5/3proxy.cfg.5.html">3proxy.cfg.5</A>
|
||||||
</body></html>
|
</body></html>
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -15,7 +15,6 @@
|
|||||||
<a href="#FILES">FILES</a><br>
|
<a href="#FILES">FILES</a><br>
|
||||||
<a href="#BUGS">BUGS</a><br>
|
<a href="#BUGS">BUGS</a><br>
|
||||||
<a href="#SEE ALSO">SEE ALSO</a><br>
|
<a href="#SEE ALSO">SEE ALSO</a><br>
|
||||||
<a href="#TRIVIA">TRIVIA</a><br>
|
|
||||||
<a href="#AUTHORS">AUTHORS</a><br>
|
<a href="#AUTHORS">AUTHORS</a><br>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@@ -59,11 +58,11 @@ multiple gateways with HTTP and HTTPS proxy with FTP over
|
|||||||
HTTP support, SOCKS v4, v4.5 and v5, POP3 proxy, UDP and TCP
|
HTTP support, SOCKS v4, v4.5 and v5, POP3 proxy, UDP and TCP
|
||||||
portmappers. Each gateway is started from the configuration
|
portmappers. Each gateway is started from the configuration
|
||||||
file like an independent service <b>proxy</b>(8)
|
file like an independent service <b>proxy</b>(8)
|
||||||
<b>socks</b>(8) <b>pop3p</b>(8) <b>tcppm</b>(8)
|
<b>socks</b>(8) <b>pop3p</b>(8) <b>imapp</b>(8)
|
||||||
<b>udppm</b>(8) <b>ftppr</b>(8) <b>dnspr</b> but
|
<b>tcppm</b>(8) <b>udppm</b>(8) <b>ftppr</b>(8) <b>dnspr</b>
|
||||||
<b>3proxy</b> is not a kind of wrapper or superserver for
|
but <b>3proxy</b> is not a kind of wrapper or superserver
|
||||||
these daemons. It just has the same code compiled in, but
|
for these daemons. It just has the same code compiled in,
|
||||||
provides much more functionality. SOCKSv5 implementation
|
but provides much more functionality. SOCKSv5 implementation
|
||||||
allows you to use 3proxy with any UDP or TCP based client
|
allows you to use 3proxy with any UDP or TCP based client
|
||||||
applications designed without proxy support (with
|
applications designed without proxy support (with
|
||||||
<i>SocksCAP</i>, <i>FreeCAP</i> or another client-side
|
<i>SocksCAP</i>, <i>FreeCAP</i> or another client-side
|
||||||
@@ -195,27 +194,18 @@ to <b>3proxy@3proxy.org</b></p>
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy.cfg(3),
|
<p style="margin-left:6%; margin-top: 1em">3proxy.cfg(5),
|
||||||
proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
|
proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8),
|
||||||
kill(1), syslogd(8), <br>
|
udppm(8), kill(1), syslogd(8), <br>
|
||||||
https://3proxy.org/</p>
|
https://3proxy.org/</p>
|
||||||
|
|
||||||
<h2>TRIVIA
|
|
||||||
<a name="TRIVIA"></a>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3APA3A is
|
|
||||||
pronounced as ``zaraza´´.</p>
|
|
||||||
|
|
||||||
<h2>AUTHORS
|
<h2>AUTHORS
|
||||||
<a name="AUTHORS"></a>
|
<a name="AUTHORS"></a>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1 align="center">3proxy_crypt</h1>
|
||||||
|
|
||||||
|
<a href="#NAME">NAME</a><br>
|
||||||
|
<a href="#SYNOPSIS">SYNOPSIS</a><br>
|
||||||
|
<a href="#DESCRIPTION">DESCRIPTION</a><br>
|
||||||
|
<a href="#OPTIONS">OPTIONS</a><br>
|
||||||
|
<a href="#EXAMPLE">EXAMPLE</a><br>
|
||||||
|
<a href="#NOTES">NOTES</a><br>
|
||||||
|
<a href="#BUGS">BUGS</a><br>
|
||||||
|
<a href="#SEE ALSO">SEE ALSO</a><br>
|
||||||
|
<a href="#AUTHORS">AUTHORS</a><br>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>NAME
|
||||||
|
<a name="NAME"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy_crypt</b>
|
||||||
|
- utility to generate encrypted passwords for 3proxy</p>
|
||||||
|
|
||||||
|
<h2>SYNOPSIS
|
||||||
|
<a name="SYNOPSIS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><b>3proxy_crypt</b>
|
||||||
|
<i>password</i> <b><br>
|
||||||
|
3proxy_crypt</b> <i>salt password</i></p>
|
||||||
|
|
||||||
|
<h2>DESCRIPTION
|
||||||
|
<a name="DESCRIPTION"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><i><b>3proxy_crypt</b></i>
|
||||||
|
is a utility to generate encrypted password hashes for use
|
||||||
|
with 3proxy configuration. Encrypted passwords allow the
|
||||||
|
system to avoid storing passwords in cleartext in
|
||||||
|
configuration files.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">When invoked
|
||||||
|
with a single argument, it produces an NT password hash
|
||||||
|
(MD4-based, suitable for NTLM authentication). The output is
|
||||||
|
prefixed with <b>NT:</b>.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">When invoked
|
||||||
|
with two arguments (salt and password), it produces a
|
||||||
|
BLAKE2b password hash. The salt length is limited to 64
|
||||||
|
characters. The output is prefixed with <b>CR:</b>.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">The resulting
|
||||||
|
hash can be used in the 3proxy configuration file with the
|
||||||
|
<b>users</b> directive instead of a cleartext password.</p>
|
||||||
|
|
||||||
|
<h2>OPTIONS
|
||||||
|
<a name="OPTIONS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><i>password</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">Cleartext password to
|
||||||
|
encrypt.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="5%">
|
||||||
|
|
||||||
|
|
||||||
|
<p><i>salt</i></p></td>
|
||||||
|
<td width="4%"></td>
|
||||||
|
<td width="65%">
|
||||||
|
|
||||||
|
|
||||||
|
<p>Salt string for BLAKE2b hashing (max 64 characters).</p></td>
|
||||||
|
<td width="20%">
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2>EXAMPLE
|
||||||
|
<a name="EXAMPLE"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">Generate NT
|
||||||
|
password hash:</p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">3proxy_crypt
|
||||||
|
MySecretPassword</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;">Result:</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">NT:3F7E6D8D96E8E7A9B0C1D2E3F4A5B6C7</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;">Generate BLAKE2b password hash
|
||||||
|
with salt:</p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">3proxy_crypt MySalt
|
||||||
|
MySecretPassword</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;">Result:</p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">CR:$3$MySalt$...</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;">Using in 3proxy.cfg:</p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">users
|
||||||
|
user1:CR:$3$MySalt$...</p>
|
||||||
|
|
||||||
|
<h2>NOTES
|
||||||
|
<a name="NOTES"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">The NT hash uses
|
||||||
|
the RSA MD4 Message-Digest Algorithm. The BLAKE2b hash uses
|
||||||
|
the BLAKE2 cryptographic hash function.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">When a password
|
||||||
|
hash is prefixed with <b>NT:</b> or <b>CR:</b>, 3proxy uses
|
||||||
|
the corresponding algorithm to verify passwords instead of
|
||||||
|
comparing cleartext strings.</p>
|
||||||
|
|
||||||
|
<h2>BUGS
|
||||||
|
<a name="BUGS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
|
<h2>SEE ALSO
|
||||||
|
<a name="SEE ALSO"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
|
3proxy.cfg(5), <br>
|
||||||
|
https://3proxy.org/</p>
|
||||||
|
|
||||||
|
<h2>AUTHORS
|
||||||
|
<a name="AUTHORS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
|
<hr>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -116,19 +116,45 @@ authentication.</p> </td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/ftppr.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -194,7 +220,7 @@ with FTP proxy support, configure <i>internal_ip</i> and
|
|||||||
FTP proxy support, use <i>internal_ip</i> and <i>port</i> as
|
FTP proxy support, use <i>internal_ip</i> and <i>port</i> as
|
||||||
the FTP server. The address of the real FTP server must be
|
the FTP server. The address of the real FTP server must be
|
||||||
configured as a part of the FTP username. The format for the
|
configured as a part of the FTP username. The format for the
|
||||||
username is <i>username</i><b>@</b><i>server</i>, where
|
username is <i>username</i>@<i>server</i>, where
|
||||||
<i>server</i> is the address of the FTP server and
|
<i>server</i> is the address of the FTP server and
|
||||||
<i>username</i> is the user´s login on this FTP
|
<i>username</i> is the user´s login on this FTP
|
||||||
server. The login itself may contain an ´@´
|
server. The login itself may contain an ´@´
|
||||||
@@ -225,8 +251,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,287 @@
|
|||||||
|
<!-- Creator : groff version 1.24.1 -->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1 align="center">imapp</h1>
|
||||||
|
|
||||||
|
<a href="#NAME">NAME</a><br>
|
||||||
|
<a href="#SYNOPSIS">SYNOPSIS</a><br>
|
||||||
|
<a href="#DESCRIPTION">DESCRIPTION</a><br>
|
||||||
|
<a href="#OPTIONS">OPTIONS</a><br>
|
||||||
|
<a href="#CLIENTS">CLIENTS</a><br>
|
||||||
|
<a href="#BUGS">BUGS</a><br>
|
||||||
|
<a href="#SEE ALSO">SEE ALSO</a><br>
|
||||||
|
<a href="#AUTHORS">AUTHORS</a><br>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>NAME
|
||||||
|
<a name="NAME"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><b>imapp</b> -
|
||||||
|
IMAPv4 proxy gateway service</p>
|
||||||
|
|
||||||
|
<h2>SYNOPSIS
|
||||||
|
<a name="SYNOPSIS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><b>imapp</b>
|
||||||
|
[<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>-e</b><i>external_ip</i>]
|
||||||
|
[<b>-h</b><i>default_ip[:port]</i>] [<b>-x</b><i>]</i></p>
|
||||||
|
|
||||||
|
<h2>DESCRIPTION
|
||||||
|
<a name="DESCRIPTION"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em"><i><b>imapp</b></i>
|
||||||
|
is IMAPv4 (IMAP4rev1) gateway service to allow internal
|
||||||
|
users to access external IMAP servers.</p>
|
||||||
|
|
||||||
|
<h2>OPTIONS
|
||||||
|
<a name="OPTIONS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-I</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Inetd mode. Standalone service
|
||||||
|
only.</p> </td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Daemonize. Detach service from
|
||||||
|
console and run in the background.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Be silenT. Do not log
|
||||||
|
start/stop/accept error records.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Never look for username
|
||||||
|
authentication.</p> </td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">External address. IP address of
|
||||||
|
the interface the proxy should initiate connections from. By
|
||||||
|
default, the system will decide which address to use in
|
||||||
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p><b>-i</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p>Internal address. IP address the proxy accepts
|
||||||
|
connections to. By default, connections to any interface are
|
||||||
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/imapp.sock). On Linux, abstract
|
||||||
|
sockets use <i>-iunix:@socketname</i> syntax.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-p</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
|
incoming connections. Default is 143.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-h</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Default destination. It’s
|
||||||
|
used if the target address is not specified by the user.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Disable STARTTLS support.
|
||||||
|
STARTTLS is not announced in the CAPABILITY response and the
|
||||||
|
STARTTLS command is not accepted.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-l</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Log. By default logging is to
|
||||||
|
stdout. If <i>logfile</i> is specified logging is to file.
|
||||||
|
Under Unix, if ´<i>@</i>´ precedes
|
||||||
|
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Increase or decrease stack size.
|
||||||
|
You may want to try something like -S8192 if you experience
|
||||||
|
3proxy crashes.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2>CLIENTS
|
||||||
|
<a name="CLIENTS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">You can use any
|
||||||
|
MUA (Mail User Agent) with IMAPv4 support. Set the client to
|
||||||
|
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
|
||||||
|
part of the IMAP username. The format for the username is
|
||||||
|
<i>username</i>@<i>server</i>, where <i>server</i> is the
|
||||||
|
address of the IMAP server and <i>username</i> is the
|
||||||
|
user´s login on this IMAP server. The login itself may
|
||||||
|
contain an ´@´ sign. Supported client
|
||||||
|
authentication methods are the LOGIN command, AUTHENTICATE
|
||||||
|
PLAIN and AUTHENTICATE LOGIN. With the server, the proxy
|
||||||
|
authenticates using the method chosen by the client if the
|
||||||
|
server supports it (as advertised in the CAPABILITY
|
||||||
|
response); otherwise it falls back to AUTHENTICATE LOGIN,
|
||||||
|
AUTHENTICATE PLAIN or the LOGIN command, in this order of
|
||||||
|
preference. Challenge-response authentication (CRAM-MD5,
|
||||||
|
etc.) is not supported, because it requires a challenge from
|
||||||
|
the server before we know which server to connect to. When
|
||||||
|
running as a 3proxy service (not as a standalone binary),
|
||||||
|
STARTTLS is supported and announced in the CAPABILITY
|
||||||
|
response unless disabled with <b>-x</b>. After the client
|
||||||
|
issues STARTTLS, the connection is handled by
|
||||||
|
<b>tlspr</b>(8): the destination host is taken from the SNI
|
||||||
|
of the client TLS handshake (or from the -h option), the
|
||||||
|
proxy performs STARTTLS negotiation with the destination
|
||||||
|
server, and then transparently passes TLS traffic between
|
||||||
|
the client and the server. If the destination server does
|
||||||
|
not support STARTTLS, the TLS handshake with the client
|
||||||
|
fails.</p>
|
||||||
|
|
||||||
|
<h2>BUGS
|
||||||
|
<a name="BUGS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">Report all bugs
|
||||||
|
to <b>3proxy@3proxy.org</b></p>
|
||||||
|
|
||||||
|
<h2>SEE ALSO
|
||||||
|
<a name="SEE ALSO"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">3proxy(8),
|
||||||
|
ftppr(8), pop3p(8), proxy(8), smtpp(8), socks(8), tcppm(8),
|
||||||
|
tlspr(8), udppm(8), syslogd(8), <br>
|
||||||
|
https://3proxy.org/</p>
|
||||||
|
|
||||||
|
<h2>AUTHORS
|
||||||
|
<a name="AUTHORS"></a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
|
<hr>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+61
-13
@@ -36,15 +36,16 @@ POP3 proxy gateway service</p>
|
|||||||
[<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>]
|
||||||
[<b>-h</b><i>default_ip[:port]</i>]</p>
|
[<b>-h</b><i>default_ip[:port]</i>] [<b>-x</b><i>]</i></p>
|
||||||
|
|
||||||
<h2>DESCRIPTION
|
<h2>DESCRIPTION
|
||||||
<a name="DESCRIPTION"></a>
|
<a name="DESCRIPTION"></a>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em"><b>pop3p</b> is
|
|
||||||
POP3 gateway service to allow internal users to access
|
<p style="margin-left:6%; margin-top: 1em"><i><b>pop3p</b></i>
|
||||||
|
is POP3 gateway service to allow internal users to access
|
||||||
external POP3 servers.</p>
|
external POP3 servers.</p>
|
||||||
|
|
||||||
<h2>OPTIONS
|
<h2>OPTIONS
|
||||||
@@ -116,19 +117,45 @@ authentication.</p> </td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/pop3p.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -158,6 +185,19 @@ used if the target address is not specified by the user.</p></td></tr>
|
|||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Disable STARTTLS (STLS) support.
|
||||||
|
STLS is not announced in the CAPA response and the STLS
|
||||||
|
command is not accepted.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><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="85%">
|
<td width="85%">
|
||||||
@@ -192,14 +232,23 @@ 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
|
||||||
of the POP3 username. The format for the username is
|
of the POP3 username. The format for the username is
|
||||||
<i>username</i><b>@</b><i>server</i>, where <i>server</i> is
|
<i>username</i>@<i>server</i>, where <i>server</i> is the
|
||||||
the address of the POP3 server and <i>username</i> is the
|
address of the POP3 server and <i>username</i> is the
|
||||||
user´s login on this POP3 server. The login itself may
|
user´s login on this POP3 server. The login itself may
|
||||||
contain an ´@´ sign. Only cleartext
|
contain an ´@´ sign. Only cleartext
|
||||||
authentication is supported, because challenge-response
|
authentication is supported, because challenge-response
|
||||||
authentication (APOP, CRAM-MD5, etc.) requires a challenge
|
authentication (APOP, CRAM-MD5, etc.) requires a challenge
|
||||||
from the server before we know which server to connect
|
from the server before we know which server to connect to.
|
||||||
to.</p>
|
When running as a 3proxy service (not as a standalone
|
||||||
|
binary), STLS is supported and announced in the CAPA
|
||||||
|
response unless disabled with <b>-x</b>. After the client
|
||||||
|
issues STLS, the connection is handled by <b>tlspr</b>(8):
|
||||||
|
the destination host is taken from the SNI of the client TLS
|
||||||
|
handshake (or from the -h option), the proxy performs STLS
|
||||||
|
negotiation with the destination server, and then
|
||||||
|
transparently passes TLS traffic between the client and the
|
||||||
|
server. If the destination server does not support STLS, the
|
||||||
|
TLS handshake with the client fails.</p>
|
||||||
|
|
||||||
<h2>BUGS
|
<h2>BUGS
|
||||||
<a name="BUGS"></a>
|
<a name="BUGS"></a>
|
||||||
@@ -225,8 +274,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+41
-16
@@ -55,11 +55,11 @@ support.</p>
|
|||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<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="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -67,11 +67,11 @@ support.</p>
|
|||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -79,11 +79,11 @@ only.</p> </td></tr>
|
|||||||
console and run in the 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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -91,11 +91,11 @@ console and run in the background.</p></td></tr>
|
|||||||
start/stop/accept error records.</p></td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -103,11 +103,11 @@ start/stop/accept error records.</p></td></tr>
|
|||||||
authentication</p> </td></tr>
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -115,19 +115,45 @@ authentication</p> </td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/proxy.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
@@ -230,8 +256,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+61
-12
@@ -36,15 +36,16 @@ SMTP proxy gateway service</p>
|
|||||||
[<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>]
|
||||||
[<b>-h</b><i>default_ip[:port]</i>]</p>
|
[<b>-h</b><i>default_ip[:port]</i>] [<b>-x</b><i>]</i></p>
|
||||||
|
|
||||||
<h2>DESCRIPTION
|
<h2>DESCRIPTION
|
||||||
<a name="DESCRIPTION"></a>
|
<a name="DESCRIPTION"></a>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em"><b>smtpp</b> is
|
|
||||||
SMTP gateway service to allow internal users to access
|
<p style="margin-left:6%; margin-top: 1em"><i><b>smtpp</b></i>
|
||||||
|
is SMTP gateway service to allow internal users to access
|
||||||
external SMTP servers.</p>
|
external SMTP servers.</p>
|
||||||
|
|
||||||
<h2>OPTIONS
|
<h2>OPTIONS
|
||||||
@@ -116,19 +117,45 @@ authentication.</p> </td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/smtpp.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -140,7 +167,7 @@ interface are accepted. It´s usually unsafe.</p></td></tr>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Port. Port proxy listens for
|
<p style="margin-top: 1em">Port. Port proxy listens for
|
||||||
incoming connections. Default is 25.</p></td></tr>
|
incoming connections. Default is 587.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -158,6 +185,19 @@ used if the target address is not specified by the user.</p></td></tr>
|
|||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em"><b>-x</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p style="margin-top: 1em">Disable STARTTLS support.
|
||||||
|
STARTTLS is not announced in the EHLO response and the
|
||||||
|
STARTTLS command is not accepted.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><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="85%">
|
<td width="85%">
|
||||||
@@ -192,14 +232,24 @@ 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
|
||||||
configured as a part of the SMTP username. The format for
|
configured as a part of the SMTP username. The format for
|
||||||
the username is <i>username</i><b>@</b><i>server</i>, where
|
the username is <i>username</i>@<i>server</i>, where
|
||||||
<i>server</i> is the address of the SMTP server and
|
<i>server</i> is the address of the SMTP server and
|
||||||
<i>username</i> is the user´s login on this SMTP
|
<i>username</i> is the user´s login on this SMTP
|
||||||
server. The login itself may contain an ´@´
|
server. The login itself may contain an ´@´
|
||||||
sign. Only cleartext authentication is supported, because
|
sign. Only cleartext authentication is supported, because
|
||||||
challenge-response authentication (CRAM-MD5, SPA, etc.)
|
challenge-response authentication (CRAM-MD5, SPA, etc.)
|
||||||
requires a challenge from the server before we know which
|
requires a challenge from the server before we know which
|
||||||
server to connect to.</p>
|
server to connect to. When running as a 3proxy service (not
|
||||||
|
as a standalone binary), STARTTLS is supported and announced
|
||||||
|
in the EHLO response unless disabled with <b>-x</b>. After
|
||||||
|
the client issues STARTTLS, the connection is handled by
|
||||||
|
<b>tlspr</b>(8): the destination host is taken from the SNI
|
||||||
|
of the client TLS handshake (or from the -h option), the
|
||||||
|
proxy performs STARTTLS negotiation with the destination
|
||||||
|
server, and then transparently passes TLS traffic between
|
||||||
|
the client and the server. If the destination server does
|
||||||
|
not support STARTTLS, the TLS handshake with the client
|
||||||
|
fails.</p>
|
||||||
|
|
||||||
<h2>BUGS
|
<h2>BUGS
|
||||||
<a name="BUGS"></a>
|
<a name="BUGS"></a>
|
||||||
@@ -225,8 +275,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+45
-20
@@ -57,11 +57,11 @@ connections and UDP portmapping.</p>
|
|||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<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="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -69,11 +69,11 @@ connections and UDP portmapping.</p>
|
|||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -81,11 +81,11 @@ only.</p> </td></tr>
|
|||||||
console and run in the 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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -93,11 +93,11 @@ console and run in the background.</p></td></tr>
|
|||||||
start/stop/accept error records.</p></td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -105,11 +105,11 @@ start/stop/accept error records.</p></td></tr>
|
|||||||
authentication</p> </td></tr>
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -118,22 +118,44 @@ the interface the proxy should initiate connections from.
|
|||||||
External IP must be specified if you need incoming
|
External IP must be specified if you need incoming
|
||||||
connections. By default, the system will decide which
|
connections. By default, the system will decide which
|
||||||
address to use in accordance with the routing table.</p></td></tr>
|
address to use in accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-Ne</b></p></td>
|
<p><b>-Ne</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">External NAT address 3proxy
|
<p>External NAT address 3proxy reports to client for
|
||||||
reports to client for CONNECT/BIND. This is external address
|
CONNECT/BIND. This is external address of NAT between 3proxy
|
||||||
of NAT between 3proxy and destination server. By default,
|
and destination server. By default, the external address is
|
||||||
the external address is reported. It’s only useful in
|
reported. It’s only useful in the case of IP-IP NAT
|
||||||
the case of IP-IP NAT and does not work with port
|
and does not work with port translation.</p></td></tr>
|
||||||
translation.</p> </td></tr>
|
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
@@ -162,7 +184,11 @@ and does not work with port translation.</p></td></tr>
|
|||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p style="margin-top: 1em">Internal address. IP address the
|
||||||
proxy accepts connections to. By default, connections to any
|
proxy accepts connections to. By default, connections to any
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
interface are accepted. It´s usually unsafe. Unix
|
||||||
|
domain sockets can be specified with
|
||||||
|
<i>-iunix:/path/to/socket</i> syntax (e.g.,
|
||||||
|
-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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
@@ -243,8 +269,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -104,19 +104,45 @@ start/stop/accept error records.</p></td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/tcppm.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -160,12 +186,18 @@ connections on</p>
|
|||||||
<p style="margin-left:6%;"><i>remote_host</i></p>
|
<p style="margin-left:6%;"><i>remote_host</i></p>
|
||||||
|
|
||||||
<p style="margin-left:15%;">- IP address of the host the
|
<p style="margin-left:15%;">- IP address of the host the
|
||||||
connection is forwarded to</p>
|
connection is forwarded to. Unix domain sockets can be
|
||||||
|
specified with the syntax <i>unix:/path/to/socket</i> (e.g.,
|
||||||
|
unix:/var/run/app.sock). On Linux, abstract (fileless) Unix
|
||||||
|
sockets use the syntax <i>unix:@socketname</i> (e.g.,
|
||||||
|
unix:@app.socket).</p>
|
||||||
|
|
||||||
<p style="margin-left:6%;"><i>remote_port</i></p>
|
<p style="margin-left:6%;"><i>remote_port</i></p>
|
||||||
|
|
||||||
<p style="margin-left:15%;">- remote port the connection is
|
<p style="margin-left:15%;">- remote port the connection is
|
||||||
forwarded to</p>
|
forwarded to. Ignored when using Unix socket destination,
|
||||||
|
but must be specified (use any positive value) for syntax
|
||||||
|
compatibility.</p>
|
||||||
|
|
||||||
<h2>CLIENTS
|
<h2>CLIENTS
|
||||||
<a name="CLIENTS"></a>
|
<a name="CLIENTS"></a>
|
||||||
@@ -202,8 +234,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+83
-24
@@ -49,7 +49,9 @@ SNI proxy gateway service</p>
|
|||||||
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
|
||||||
plugin).</p>
|
plugin). tlspr does not support user authentication; use
|
||||||
|
ACLs by client IP or a parent proxy with authentication if
|
||||||
|
access control is required.</p>
|
||||||
|
|
||||||
<h2>OPTIONS
|
<h2>OPTIONS
|
||||||
<a name="OPTIONS"></a>
|
<a name="OPTIONS"></a>
|
||||||
@@ -60,11 +62,11 @@ plugin).</p>
|
|||||||
cellspacing="0" cellpadding="0">
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<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="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -72,11 +74,11 @@ plugin).</p>
|
|||||||
only.</p> </td></tr>
|
only.</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-d</b></p></td>
|
<p style="margin-top: 1em"><b>-d</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -84,11 +86,11 @@ only.</p> </td></tr>
|
|||||||
console and run in the 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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-t</b></p></td>
|
<p style="margin-top: 1em"><b>-t</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -96,11 +98,11 @@ console and run in the background.</p></td></tr>
|
|||||||
start/stop/accept error records.</p></td></tr>
|
start/stop/accept error records.</p></td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-u</b></p></td>
|
<p style="margin-top: 1em"><b>-u</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -108,11 +110,11 @@ start/stop/accept error records.</p></td></tr>
|
|||||||
authentication</p> </td></tr>
|
authentication</p> </td></tr>
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-e</b></p></td>
|
<p style="margin-top: 1em"><b>-e</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -120,19 +122,45 @@ authentication</p> </td></tr>
|
|||||||
the interface the proxy should initiate connections from. By
|
the interface the proxy should initiate connections from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts
|
||||||
proxy accepts connections to. By default, connections to any
|
connections to. By default, connections to any interface are
|
||||||
interface are accepted. It´s usually unsafe.</p></td></tr>
|
accepted. It´s usually unsafe. Unix domain sockets can
|
||||||
|
be specified with <i>-iunix:/path/to/socket</i> syntax
|
||||||
|
(e.g., -iunix:/var/run/tlspr.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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="4%">
|
||||||
@@ -206,22 +234,54 @@ with TLS 1.3)</p></td></tr>
|
|||||||
<td width="4%">
|
<td width="4%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-l</b></p></td>
|
<p style="margin-top: 1em"><b>-s</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="5%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Log. By default logging is to
|
<p style="margin-top: 1em">Split the TLS Client HELLO
|
||||||
stdout. If <i>logfile</i> is specified logging is to file.
|
packet across multiple TCP segments to make SNI-based DPI
|
||||||
Under Unix, if ´<i>@</i>´ precedes
|
detection harder. An optional numeric value can follow (e.g.
|
||||||
<i>logfile</i>, syslog is used for logging.</p></td></tr>
|
<b>-s1</b>) to control the splitting behaviour.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-Ximap | -Xpop3 |
|
||||||
|
-Xsmtp</b></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">STARTTLS mode for the given
|
||||||
|
protocol. The proxy speaks the plaintext protocol with the
|
||||||
|
client (greeting, capability advertisement with STARTTLS
|
||||||
|
only, STARTTLS command), then, after the client issues
|
||||||
|
STARTTLS and sends a TLS Client HELLO, connects to the
|
||||||
|
destination taken from SNI (default port 143/110/587),
|
||||||
|
performs STARTTLS negotiation with the destination server
|
||||||
|
and transparently passes TLS traffic. If the destination
|
||||||
|
server does not support STARTTLS, the TLS handshake with the
|
||||||
|
client fails.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="4%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
|
<p><b>-l</b></p></td>
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
|
<p>Log. By default logging is to stdout. If <i>logfile</i>
|
||||||
|
is specified logging is to file. Under Unix, if
|
||||||
|
´<i>@</i>´ precedes <i>logfile</i>, syslog is
|
||||||
|
used for logging.</p></td></tr>
|
||||||
|
<tr valign="top" align="left">
|
||||||
|
<td width="6%"></td>
|
||||||
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-S</b></p></td>
|
<p style="margin-top: 1em"><b>-S</b></p></td>
|
||||||
<td width="5%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
@@ -265,8 +325,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -104,19 +104,42 @@ start/stop/accept error records.</p></td></tr>
|
|||||||
the interface the proxy should initiate datagrams from. By
|
the interface the proxy should initiate datagrams from. By
|
||||||
default, the system will decide which address to use in
|
default, the system will decide which address to use in
|
||||||
accordance with the routing table.</p></td></tr>
|
accordance with the routing table.</p></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ni</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> before opening
|
||||||
|
the listening socket. The current namespace is saved and
|
||||||
|
restored immediately after binding, so outgoing connections
|
||||||
|
run in the original namespace unless <b>-ne</b> is also
|
||||||
|
given.</p>
|
||||||
|
|
||||||
|
<p style="margin-left:6%;"><b>-ne</b><i>PATH</i></p>
|
||||||
|
|
||||||
|
<p style="margin-left:15%;">(Linux only) Switch to the
|
||||||
|
network namespace identified by <i>PATH</i> after the
|
||||||
|
listening socket has been bound (and after restoring from
|
||||||
|
<b>-ni</b> if applicable). Both options accept any namespace
|
||||||
|
file path (e.g. <i>/var/run/netns/myns</i> or
|
||||||
|
<i>/proc/PID/ns/net</i>) and require
|
||||||
|
<b>CAP_SYS_ADMIN</b>.</p>
|
||||||
|
|
||||||
|
<table width="100%" border="0" rules="none" frame="void"
|
||||||
|
cellspacing="0" cellpadding="0">
|
||||||
<tr valign="top" align="left">
|
<tr valign="top" align="left">
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em"><b>-i</b></p></td>
|
<p><b>-i</b></p></td>
|
||||||
<td width="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="85%">
|
<td width="85%">
|
||||||
|
|
||||||
|
|
||||||
<p style="margin-top: 1em">Internal address. IP address the
|
<p>Internal address. IP address the proxy accepts datagrams
|
||||||
proxy accepts datagrams to. By default, connections to any
|
to. By default, connections to any interface are accepted.
|
||||||
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="6%"></td>
|
<td width="6%"></td>
|
||||||
<td width="3%">
|
<td width="3%">
|
||||||
@@ -218,8 +241,7 @@ https://3proxy.org/</p>
|
|||||||
|
|
||||||
|
|
||||||
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
<p style="margin-left:6%; margin-top: 1em">3proxy is
|
||||||
designed by Vladimir 3APA3A Dubrovin
|
designed by Vladimir Dubrovin <vlad@3proxy.org></p>
|
||||||
(<i>3proxy@3proxy.org</i>)</p>
|
|
||||||
<hr>
|
<hr>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
|
|
||||||
<h3>3proxy Perl Compatible Regular Expressions (PCRE) Plugin</h3>
|
|
||||||
|
|
||||||
This filtering plugin can be used to create matching and replacement
|
|
||||||
rules with regular expressions for client requests, client and
|
|
||||||
server headers, and client and server data. It adds 3 additional
|
|
||||||
configuration commands:
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
pcre TYPE FILTER_ACTION REGEXP [ACE]
|
|
||||||
pcre_rewrite TYPE FILTER_ACTION REGEXP REWRITE_EXPRESSION [ACE]
|
|
||||||
pcre_extend FILTER_ACTION [ACE]
|
|
||||||
pcre_options OPTION1 [...]
|
|
||||||
</pre>
|
|
||||||
pcre - allows applying a rule for matching
|
|
||||||
<br>pcre_rewrite - in addition to 'pcre', allows substituting substrings
|
|
||||||
<br>pcre_extend - extends the ACL of the last pcre or pcre_rewrite command by
|
|
||||||
adding an additional ACE (like with allow/deny configuration commands).
|
|
||||||
<br>pcre_options - allows setting matching options. Available options are:
|
|
||||||
PCRE_CASELESS,
|
|
||||||
PCRE_MULTILINE,
|
|
||||||
PCRE_DOTALL,
|
|
||||||
PCRE_EXTENDED,
|
|
||||||
PCRE_ANCHORED,
|
|
||||||
PCRE_DOLLAR_ENDONLY,
|
|
||||||
PCRE_EXTRA,
|
|
||||||
PCRE_NOTBOL,
|
|
||||||
PCRE_NOTEOL,
|
|
||||||
PCRE_UNGREEDY,
|
|
||||||
PCRE_NOTEMPTY,
|
|
||||||
PCRE_UTF8,
|
|
||||||
PCRE_NO_AUTO_CAPTURE,
|
|
||||||
PCRE_NO_UTF8_CHECK,
|
|
||||||
PCRE_AUTO_CALLOUT,
|
|
||||||
PCRE_PARTIAL,
|
|
||||||
PCRE_DFA_SHORTEST,
|
|
||||||
PCRE_DFA_RESTART,
|
|
||||||
PCRE_FIRSTLINE,
|
|
||||||
PCRE_DUPNAMES,
|
|
||||||
PCRE_NEWLINE_CR,
|
|
||||||
PCRE_NEWLINE_LF,
|
|
||||||
PCRE_NEWLINE_CRLF,
|
|
||||||
PCRE_NEWLINE_ANY,
|
|
||||||
PCRE_NEWLINE_ANYCRLF,
|
|
||||||
PCRE_BSR_ANYCRLF,
|
|
||||||
PCRE_BSR_UNICODE
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>TYPE - type of filtered data. May contain one or more
|
|
||||||
(comma-delimited list) values:
|
|
||||||
<ul>
|
|
||||||
<li>request - content of the client's request, e.g., the HTTP GET request string.
|
|
||||||
(known problem: changing the request string doesn't change the IP of the host to connect to)
|
|
||||||
<li>cliheader - content of the client request headers, e.g., HTTP request headers.
|
|
||||||
<li>srvheader - content of the server's reply headers, e.g., HTTP status and headers.
|
|
||||||
<li>clidata - data received from the client, e.g., HTTP POST request data
|
|
||||||
<li>srvdata - data received from the server, e.g., an HTML page
|
|
||||||
</ul>
|
|
||||||
<li>FILTER_ACTION - action on match
|
|
||||||
<ul><li>allow - allow this request without checking the rest of the rules for the given type
|
|
||||||
<li>deny - deny this request without checking the rest of the rules
|
|
||||||
<li>dunno - continue with the rest of the rules (useful with pcre_rewrite)
|
|
||||||
</ul>
|
|
||||||
<li>REGEXP - PCRE (Perl) regular expression. Use * if no regexp matching
|
|
||||||
is required.
|
|
||||||
<li>REWRITE_EXPRESSION - substitution string. May contain Perl-style
|
|
||||||
substrings
|
|
||||||
(not tested) $1, $2. $0 means the whole matched string. \r and \n may be used
|
|
||||||
to insert new strings; the string may be empty ("").
|
|
||||||
<li>ACE - access control entry (user names, source IPs, destination IPs,
|
|
||||||
ports, etc.), absolutely identical to allow/deny/bandlimin commands.
|
|
||||||
The regular expression is only matched if the ACL matches the connection data.
|
|
||||||
Warning:
|
|
||||||
Regular expressions don't require authentication and cannot replace
|
|
||||||
authentication and/or allow/deny ACLs.
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<h4>Example:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin PCREPlugin.dll pcre_plugin
|
|
||||||
pcre request deny "porn|sex" user1,user2,user3 192.168.0.0/16
|
|
||||||
pcre srvheader deny "Content-type: application"
|
|
||||||
pcre_rewrite clidata,srvdata dunno "porn|sex|pussy" "***" baduser
|
|
||||||
pcre_extend deny * 192.168.0.1/16
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h4>Download:</h4>
|
|
||||||
<ul>
|
|
||||||
<li>Plugin is included in the 3proxy 0.6 binary and source distribution
|
|
||||||
<li>Example configuration (by Dennis Garber): <A HREF="NoPornLitest.cfg.txt">NoPornLitest.cfg</A>
|
|
||||||
</li></ul>
|
|
||||||
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
<h3>Плагин регулярных выражений совместимых с Perl (PCRE) для 3proxy</h3>
|
|
||||||
|
|
||||||
Фильтрующий плагин используется для создания правил поиска и замены
|
|
||||||
регулярных выражений в запросе, заголовков запроса и ответа и данных.
|
|
||||||
Добавляет поддержку 3х новых команд в файле конфигурации:
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
pcre TYPE FILTER_ACTION REGEXP [ACE]
|
|
||||||
pcre_rewrite TYPE FILTER_ACTION REGEXP REWRITE_EXPRESSION [ACE]
|
|
||||||
pcre_extend FILTER_ACTION [ACE]
|
|
||||||
pcre_options OPTION1 [...]
|
|
||||||
</pre>
|
|
||||||
pcre - позволяет искать совпадения
|
|
||||||
<br>pcre_rewrite - дополнительно позволяет производить замену подстрок
|
|
||||||
<br>pcre_extend - расширяет ACL последней команды pcre или pcre_rewrite путем
|
|
||||||
добавления еще одной ACE (аналогично списку правил allow/deny).
|
|
||||||
<br>pcre_options - позволяет устанавливать опции поиска, доступны следующие опции:
|
|
||||||
PCRE_CASELESS,
|
|
||||||
PCRE_MULTILINE,
|
|
||||||
PCRE_DOTALL,
|
|
||||||
PCRE_EXTENDED,
|
|
||||||
PCRE_ANCHORED,
|
|
||||||
PCRE_DOLLAR_ENDONLY,
|
|
||||||
PCRE_EXTRA,
|
|
||||||
PCRE_NOTBOL,
|
|
||||||
PCRE_NOTEOL,
|
|
||||||
PCRE_UNGREEDY,
|
|
||||||
PCRE_NOTEMPTY,
|
|
||||||
PCRE_UTF8,
|
|
||||||
PCRE_NO_AUTO_CAPTURE,
|
|
||||||
PCRE_NO_UTF8_CHECK,
|
|
||||||
PCRE_AUTO_CALLOUT,
|
|
||||||
PCRE_PARTIAL,
|
|
||||||
PCRE_DFA_SHORTEST,
|
|
||||||
PCRE_DFA_RESTART,
|
|
||||||
PCRE_FIRSTLINE,
|
|
||||||
PCRE_DUPNAMES,
|
|
||||||
PCRE_NEWLINE_CR,
|
|
||||||
PCRE_NEWLINE_LF,
|
|
||||||
PCRE_NEWLINE_CRLF,
|
|
||||||
PCRE_NEWLINE_ANY,
|
|
||||||
PCRE_NEWLINE_ANYCRLF,
|
|
||||||
PCRE_BSR_ANYCRLF,
|
|
||||||
PCRE_BSR_UNICODE
|
|
||||||
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>TYPE - тип фильтруемых данных. Может содержать одно или
|
|
||||||
несколько (список через запятую) значений:
|
|
||||||
<ul>
|
|
||||||
<li>request - содержимое запроса клиента (например строка HTTP GET-запроса).
|
|
||||||
(в настоящий момент изменение запроса не приводит к изменению адреса запрашиваемого хоста)
|
|
||||||
<li>cliheader - содержимое заголовков запроса клиента, например заголовки HTTP
|
|
||||||
<li>srvheader - содержимое заголовков ответа сервера, например заголовки HTTP
|
|
||||||
<li>clidata - данные полученные от клиента, например данные POST-запроса
|
|
||||||
<li>srvdata - данные полученные от сервера, например содержимое HTML-страницы
|
|
||||||
</ul>
|
|
||||||
<li>FILTER_ACTION - действие при совпадении. Может принимать значение
|
|
||||||
<ul><li>allow - разрешить данный запрос без просмотра дальнейших правил
|
|
||||||
<li>deny - запретить данный запрос без просмотра дальнейших правил
|
|
||||||
<li>dunno - продолжить анализ правил (полезно для pcre_rewrite)
|
|
||||||
</ul>
|
|
||||||
<li>REGEXP - регулярное выражение в формате PCRE (perl). Используйте * если не
|
|
||||||
требуется проерка регулярного выражения.
|
|
||||||
<li>REWRITE_EXPRESSION - строка замены. Может содержать макроподстановки
|
|
||||||
(не тестировалось) $1, $2 и т.д. аналогично perl. $0 - полная найденная
|
|
||||||
подстрока. В строке замены можно использовать сочетания \r, \n для вставки
|
|
||||||
новых строк. Строка может быть пустой ("").
|
|
||||||
<li>ACE - Список контроля доступа (имя пользователя, IP источника, IP назначения, порт и т.д.),
|
|
||||||
полностью аналогичный ACE в командах allow, deny, bandlimin и т.п. Регулярное
|
|
||||||
выражение проверяется только при совпадении ACE с запросом. ВНИМАНИЕ:
|
|
||||||
использование регулярных выражений не требует авторизации и не заменяет ее.
|
|
||||||
Авторизацию необходимо конфигурировать отдельно.
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<h4>Пример:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin PCREPlugin.dll pcre_plugin
|
|
||||||
pcre request deny "porn|sex" user1,user2,user3 192.168.0.0/16
|
|
||||||
pcre srvheader deny "Content-type: application"
|
|
||||||
pcre_rewrite clidata,srvdata dunno "porn|sex|pussy" "***" baduser
|
|
||||||
pcre_extend deny * 192.168.0.1/16
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
<h4>Загрузить:</h4>
|
|
||||||
<ul>
|
|
||||||
<li>Плагин включен в дистрибутив 3proxy 0.6
|
|
||||||
<li>Пример конфигурации (by Dennis Garber): <A HREF="NoPornLitest.cfg.txt">NoPornLitest.cfg</A>
|
|
||||||
</li></ul>
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
<h3>3proxy SSL/TLS Plugin</h3>
|
|
||||||
|
|
||||||
This plugin can be used to transparently decrypt SSL/TLS data, provide TLS encryption for proxy traffic, and authenticate using client certificates.
|
|
||||||
|
|
||||||
<h4>For transparent certificate spoofing (MITM):</h4>
|
|
||||||
|
|
||||||
<br>ssl_mitm - spoof certificates for services started below. Usage without ssl_client_verify is insecure.
|
|
||||||
<br>ssl_nomitm - do not spoof certificates for services started below
|
|
||||||
|
|
||||||
<h4>To protect traffic to the server (https:// proxy):</h4>
|
|
||||||
|
|
||||||
ssl_serv (or ssl_server) - require TLS connection from clients for services below
|
|
||||||
<br>ssl_noserv (or ssl_noserver) - do not require TLS connection from clients for services below
|
|
||||||
|
|
||||||
<h4>To use TLS for upstream connections:</h4>
|
|
||||||
|
|
||||||
ssl_cli (or ssl_client) - establish TLS connection to upstream server for services below
|
|
||||||
<br>ssl_nocli (or ssl_noclient) - do not establish TLS connection to upstream server for services below
|
|
||||||
|
|
||||||
<h4>Parameters:</h4>
|
|
||||||
|
|
||||||
<br><b>ssl_server_cert</b> /path/to/cert - Server certificate (should not be self-signed and must contain an Alternative Name) for ssl_serv
|
|
||||||
<br><b>ssl_server_key</b> /path/to/key - Server certificate key for ssl_server_cert or generated MITM certificate
|
|
||||||
<br><b>ssl_client_cert</b> /path/to/cert - Client certificate for authentication on upstream server (used with ssl_cli)
|
|
||||||
<br><b>ssl_client_key</b> /path/to/key - Client certificate key for ssl_client_cert
|
|
||||||
<br><b>ssl_client_ciphersuites</b> ciphersuites_list - TLS client ciphers for TLS 1.3, e.g., ssl_client_ciphersuites TLS_AES_128_GCM_SHA256
|
|
||||||
<br><b>ssl_server_ciphersuites</b> ciphersuites_list - TLS server ciphers for TLS 1.3
|
|
||||||
<br><b>ssl_client_cipher_list</b> ciphers_list - TLS client ciphers for TLS 1.2 and below, e.g., ssl_client_cipher_list ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
|
|
||||||
<br><b>ssl_server_cipher_list</b> ciphers_list - TLS server ciphers for TLS 1.2 and below
|
|
||||||
<br><b>ssl_client_min_proto_version</b> tls_version - TLS client minimum TLS version (e.g., TLSv1.2)
|
|
||||||
<br><b>ssl_server_min_proto_version</b> tls_version - TLS server minimum TLS version (e.g., TLSv1.2)
|
|
||||||
<br><b>ssl_client_max_proto_version</b> tls_version - TLS client maximum TLS version (e.g., TLSv1.2)
|
|
||||||
<br><b>ssl_server_max_proto_version</b> tls_version - TLS server maximum TLS version (e.g., TLSv1.2)
|
|
||||||
<br><b>ssl_client_verify</b> - verify the certificate for the upstream server in TLS client functionality (used with ssl_mitm or ssl_cli)
|
|
||||||
<br><b>ssl_client_no_verify</b> - do not verify the certificate for the upstream server in TLS client functionality (default)
|
|
||||||
<br><b>ssl_server_verify</b> - require client certificate authentication (mTLS) for ssl_serv
|
|
||||||
<br><b>ssl_server_no_verify</b> - do not require client certificate (default)
|
|
||||||
<br><b>ssl_server_ca_file</b> /path/to/cafile - CA certificate file for MITM
|
|
||||||
<br><b>ssl_server_ca_key</b> /path/to/cakey - key for ssl_server_ca_file MITM CA
|
|
||||||
<br><b>ssl_server_ca_dir</b> /path/to/cadir - CA directory for ssl_server_verify
|
|
||||||
<br><b>ssl_server_ca_store</b> /path/to/castore - CA store for ssl_server_verify (OpenSSL 3.0+)
|
|
||||||
<br><b>ssl_client_ca_file</b> /path/to/cafile - CA file for ssl_client_verify
|
|
||||||
<br><b>ssl_client_ca_dir</b> /path/to/cadir - CA directory for ssl_client_verify
|
|
||||||
<br><b>ssl_client_ca_store</b> /path/to/castore - CA store for ssl_client_verify (OpenSSL 3.0+)
|
|
||||||
<br><b>ssl_client_sni</b> hostname - SNI hostname to send to upstream server (overrides the requested hostname)
|
|
||||||
<br><b>ssl_client_alpn</b> protocol1 protocol2 ... - ALPN protocols to negotiate with upstream server (e.g., ssl_client_alpn h2 http/1.1)
|
|
||||||
<br><b>ssl_client_mode</b> mode - when to establish TLS connection: 0 - on connect (default), 1 - after authentication, 2 - before data
|
|
||||||
<br><b>ssl_certcache</b> /path/to/cache/ - location for the generated MITM certificates cache, optional if ssl_server_ca_file / ssl_server_ca_key are configured.
|
|
||||||
The cache may contain 3 files: 3proxy.pem - public
|
|
||||||
self-signed certificates (used if ssl_server_ca_file is not configured),
|
|
||||||
3proxy.key - key for public certificates, used if ssl_server_ca_key is not configured, server.key - this key is used if ssl_server_key is not configured to generate
|
|
||||||
spoofed certificates. If server.key is absent, 3proxy.key is used to generate certificates.
|
|
||||||
Generated certificates are placed in the same path.
|
|
||||||
|
|
||||||
|
|
||||||
<h4>MITM example:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_ca_file /path/to/cafile
|
|
||||||
ssl_server_ca_key /path/to/cakey
|
|
||||||
ssl_mitm
|
|
||||||
proxy -p3128
|
|
||||||
ssl_nomitm
|
|
||||||
proxy -p3129
|
|
||||||
</pre>
|
|
||||||
MITM's traffic with a spoofed certificate for the port 3128 proxy.
|
|
||||||
|
|
||||||
<h4>https:// proxy example:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_cert path_to_cert
|
|
||||||
ssl_server_key path_to_key
|
|
||||||
ssl_serv
|
|
||||||
proxy -p33128
|
|
||||||
ssl_noserv
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
Creates an https:// proxy on port 33128 and an http:// proxy on port 3128
|
|
||||||
|
|
||||||
<h4>TLS client example (connect to upstream via TLS):</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_client_cert /path/to/client.crt
|
|
||||||
ssl_client_key /path/to/client.key
|
|
||||||
ssl_client_verify
|
|
||||||
ssl_client_ca_file /path/to/ca.crt
|
|
||||||
ssl_cli
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
Creates an HTTP proxy that connects to upstream servers via TLS with client certificate authentication.
|
|
||||||
|
|
||||||
<h4>mTLS example (require client certificate):</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_cert /path/to/server.crt
|
|
||||||
ssl_server_key /path/to/server.key
|
|
||||||
ssl_server_ca_file /path/to/ca.crt
|
|
||||||
ssl_server_verify
|
|
||||||
ssl_serv
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
Creates an https:// proxy that requires client certificate authentication.
|
|
||||||
|
|
||||||
© Vladimir Dubrovin, License: BSD style
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
<h3>3proxy SSL/TLS плагин</h3>
|
|
||||||
|
|
||||||
Плагин можно использовать для перехвата и дешифровки SSL/TLS трафика, для шифрования трафика прокси-сервера и аутентификации с помощью клиентских сертификатов.
|
|
||||||
|
|
||||||
<h4>Для прозрачного перехвата трафика (MITM):</h4>
|
|
||||||
|
|
||||||
<br>ssl_mitm - подменять сертификаты для сервисов, запущенных ниже. Использование без ssl_client_verify небезопасно.
|
|
||||||
<br>ssl_nomitm - не подменять сертификаты для сервисов, запущенных ниже.
|
|
||||||
|
|
||||||
<h4>Для защиты трафика прокси-сервера (https:// proxy):</h4>
|
|
||||||
|
|
||||||
ssl_serv (или ssl_server) - требовать TLS-соединение от клиентов для сервисов, запущенных ниже
|
|
||||||
<br>ssl_noserv (или ssl_noserver) - не требовать TLS-соединение от клиентов для сервисов, запущенных ниже
|
|
||||||
|
|
||||||
<h4>Для использования TLS при соединении к вышестоящему серверу:</h4>
|
|
||||||
|
|
||||||
ssl_cli (или ssl_client) - устанавливать TLS-соединение к вышестоящему серверу для сервисов, запущенных ниже
|
|
||||||
<br>ssl_nocli (или ssl_noclient) - не устанавливать TLS-соединение к вышестоящему серверу для сервисов, запущенных ниже
|
|
||||||
|
|
||||||
<h4>Параметры:</h4>
|
|
||||||
|
|
||||||
<br><b>ssl_server_cert</b> /path/to/cert - сертификат сервера (не должен быть самоподписанным, должен содержать альтернативные имена) для ssl_serv
|
|
||||||
<br><b>ssl_server_key</b> /path/to/key - ключ сертификата сервера для ssl_server_cert или сгенерированного MITM-сертификата
|
|
||||||
<br><b>ssl_client_cert</b> /path/to/cert - клиентский сертификат для аутентификации на вышестоящем сервере (используется с ssl_cli)
|
|
||||||
<br><b>ssl_client_key</b> /path/to/key - ключ клиентского сертификата для ssl_client_cert
|
|
||||||
<br><b>ssl_client_ciphersuites</b> ciphersuites_list - наборы шифров TLS для TLS 1.3 (клиент), пример: ssl_client_ciphersuites TLS_AES_128_GCM_SHA256
|
|
||||||
<br><b>ssl_server_ciphersuites</b> ciphersuites_list - наборы шифров TLS для TLS 1.3 (сервер)
|
|
||||||
<br><b>ssl_client_cipher_list</b> ciphers_list - наборы шифров TLS для TLS 1.2 и ниже (клиент), пример: ssl_client_cipher_list ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
|
|
||||||
<br><b>ssl_server_cipher_list</b> ciphers_list - наборы шифров TLS для TLS 1.2 и ниже (сервер)
|
|
||||||
<br><b>ssl_client_min_proto_version</b> tls_version - минимальная версия TLS клиента (например, ssl_client_min_proto_version TLSv1.2)
|
|
||||||
<br><b>ssl_server_min_proto_version</b> tls_version - минимальная версия TLS сервера
|
|
||||||
<br><b>ssl_client_max_proto_version</b> tls_version - максимальная версия TLS клиента
|
|
||||||
<br><b>ssl_server_max_proto_version</b> tls_version - максимальная версия TLS сервера
|
|
||||||
<br><b>ssl_client_verify</b> - проверять сертификат вышестоящего сервера (используется с ssl_mitm или ssl_cli)
|
|
||||||
<br><b>ssl_client_no_verify</b> - не проверять сертификат вышестоящего сервера (по умолчанию)
|
|
||||||
<br><b>ssl_server_verify</b> - требовать клиентский сертификат (mTLS) для ssl_serv
|
|
||||||
<br><b>ssl_server_no_verify</b> - не требовать клиентский сертификат (по умолчанию)
|
|
||||||
<br><b>ssl_server_ca_file</b> /path/to/cafile - файл CA-сертификата для MITM
|
|
||||||
<br><b>ssl_server_ca_key</b> /path/to/cakey - ключ CA-сертификата ssl_server_ca_file для MITM
|
|
||||||
<br><b>ssl_server_ca_dir</b> /path/to/cadir - директория CA-сертификатов для ssl_server_verify
|
|
||||||
<br><b>ssl_server_ca_store</b> /path/to/castore - хранилище CA-сертификатов для ssl_server_verify (OpenSSL 3.0+)
|
|
||||||
<br><b>ssl_client_ca_file</b> /path/to/cafile - файл CA-сертификатов для ssl_client_verify
|
|
||||||
<br><b>ssl_client_ca_dir</b> /path/to/cadir - директория CA-сертификатов для ssl_client_verify
|
|
||||||
<br><b>ssl_client_ca_store</b> /path/to/castore - хранилище CA-сертификатов для ssl_client_verify (OpenSSL 3.0+)
|
|
||||||
<br><b>ssl_client_sni</b> hostname - SNI-имя хоста для отправки вышестоящему серверу (переопределяет запрошенное имя хоста)
|
|
||||||
<br><b>ssl_client_alpn</b> протокол1 протокол2 ... - ALPN-протоколы для согласования с вышестоящим сервером (например, ssl_client_alpn h2 http/1.1)
|
|
||||||
<br><b>ssl_client_mode</b> режим - когда устанавливать TLS-соединение: 0 - при подключении (по умолчанию), 1 - после аутентификации, 2 - перед передачей данных
|
|
||||||
<br><b>ssl_certcache</b> /path/to/cache/ - расположение кеша сгенерированных MITM-сертификатов. Кеш может содержать
|
|
||||||
файлы 3proxy.pem, 3proxy.key, server.key, которые используются как ssl_server_ca_file,
|
|
||||||
ssl_server_ca_key и ssl_server_key соответственно, если они не заданы. Если server.key не задан,
|
|
||||||
3proxy.key используется для генерации серверного сертификата.
|
|
||||||
|
|
||||||
<h4>Пример MITM:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_ca_file /path/to/cafile
|
|
||||||
ssl_server_ca_key /path/to/cakey
|
|
||||||
ssl_mitm
|
|
||||||
proxy -p3128
|
|
||||||
ssl_nomitm
|
|
||||||
proxy -p3129
|
|
||||||
</pre>
|
|
||||||
Перехватывается трафик в прокси на порту 3128.
|
|
||||||
|
|
||||||
<h4>Пример конфигурации https:// прокси:</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_cert path_to_cert
|
|
||||||
ssl_server_key path_to_key
|
|
||||||
ssl_serv
|
|
||||||
proxy -p33128
|
|
||||||
ssl_noserv
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
На порту 33128 создается https:// прокси, на порту 3128 - http:// прокси.
|
|
||||||
|
|
||||||
<h4>Пример TLS-клиента (соединение к вышестоящему серверу через TLS):</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_client_cert /path/to/client.crt
|
|
||||||
ssl_client_key /path/to/client.key
|
|
||||||
ssl_client_verify
|
|
||||||
ssl_client_ca_file /path/to/ca.crt
|
|
||||||
ssl_cli
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
Создается HTTP-прокси, который соединяется с вышестоящими серверами через TLS с аутентификацией по клиентскому сертификату.
|
|
||||||
|
|
||||||
<h4>Пример mTLS (требование клиентского сертификата):</h4>
|
|
||||||
<pre>
|
|
||||||
plugin /path/to/SSLPlugin.so ssl_plugin
|
|
||||||
ssl_server_cert /path/to/server.crt
|
|
||||||
ssl_server_key /path/to/server.key
|
|
||||||
ssl_server_ca_file /path/to/ca.crt
|
|
||||||
ssl_server_verify
|
|
||||||
ssl_serv
|
|
||||||
proxy -p3128
|
|
||||||
</pre>
|
|
||||||
Создается https:// прокси, требующий аутентификацию по клиентскому сертификату.
|
|
||||||
|
|
||||||
© Vladimir Dubrovin, License: BSD style
|
|
||||||
@@ -27,18 +27,18 @@ plugin TrafficPlugin.dll start
|
|||||||
trafcorrect m <сервис> <исходящий порт> <коэффициент>
|
trafcorrect m <сервис> <исходящий порт> <коэффициент>
|
||||||
</pre>
|
</pre>
|
||||||
где: <сервис> может быть proxy, socks4, socks45, socks5, tcppm, udppm, pop3p
|
где: <сервис> может быть proxy, socks4, socks45, socks5, tcppm, udppm, pop3p
|
||||||
если сервис указан неверно то считается, что это может быть любой сервис.
|
если сервис указан неверно то считается, что это может быть любой сервис.
|
||||||
можно использовать *, тогда правило будет считаться для любого сервиса.
|
можно использовать *, тогда правило будет считаться для любого сервиса.
|
||||||
<br> <исходящий порт> - порт, к которому подключается прокси сервер. * - любой
|
<br> <исходящий порт> - порт, к которому подключается прокси сервер. * - любой
|
||||||
<коэффициент> - число на каоторое домнажается траффик. Обязательный параметр.
|
<коэффициент> - число на каоторое домнажается траффик. Обязательный параметр.
|
||||||
Должен быть от больше 0 и меньше 100
|
Должен быть от больше 0 и меньше 100
|
||||||
<br>
|
<br>
|
||||||
ДЛЯ РЕЖИМА С УЧЁТОМ РАЗМЕРА ЗАГОЛОВКОВ ПАКЕТОВ:
|
ДЛЯ РЕЖИМА С УЧЁТОМ РАЗМЕРА ЗАГОЛОВКОВ ПАКЕТОВ:
|
||||||
<pre>
|
<pre>
|
||||||
trafcorrect p <сервис> <tcp/udp> <исходящий порт> [размер пустого пакета]
|
trafcorrect p <сервис> <tcp/udp> <исходящий порт> [размер пустого пакета]
|
||||||
</pre>
|
</pre>
|
||||||
<tcp/udp> - протокол, по которому осуществляется соединение.
|
<tcp/udp> - протокол, по которому осуществляется соединение.
|
||||||
[размер пакета] - средний размер пустого пакета. Можно определить захватив
|
[размер пакета] - средний размер пустого пакета. Можно определить захватив
|
||||||
данные при помощи такой утилиты как Ethereal. Параметр необязателен. Если отсутствует,
|
данные при помощи такой утилиты как Ethereal. Параметр необязателен. Если отсутствует,
|
||||||
то размер пакета будет считаться равным 66 байт.
|
то размер пакета будет считаться равным 66 байт.
|
||||||
<br>Режимы можно смешивать.
|
<br>Режимы можно смешивать.
|
||||||
|
|||||||
@@ -25,6 +25,26 @@ with an unreachable DNS server (because gethostbyname will block other threads).
|
|||||||
user requests can be logged.
|
user requests can be logged.
|
||||||
<li>Use -xyz+A character filtering sequences for 'logformat', especially with
|
<li>Use -xyz+A character filtering sequences for 'logformat', especially with
|
||||||
ODBC logging, to prevent SQL and log record injections.
|
ODBC logging, to prevent SQL and log record injections.
|
||||||
|
<li>With the 'cacheacl' authentication type the ACL result is cached and is not
|
||||||
|
re-evaluated on a cache hit, so every field the ACL limits must be a part of
|
||||||
|
the 'authcache' key. Any field the ACL limits but the key does not contain
|
||||||
|
makes the cached result apply to a request it was not computed for, and that
|
||||||
|
limitation is not enforced. Use 'user' and 'pass' for the userlist, 'ip' for
|
||||||
|
the sourcelist, 'dstaddr' and 'dsthost' for the targetlist, 'dstport' for the
|
||||||
|
targetportlist and 'dstoper' for the operationlist. Use plain 'cache' instead
|
||||||
|
of 'cacheacl' if ACLs may change during the cache lifetime; cache entries are
|
||||||
|
not invalidated by a configuration reload.
|
||||||
|
<li>'cacheacl' must not be used together with parent proxies. The ACL is not
|
||||||
|
walked on a cache hit, so no redirection is applied and the request is sent
|
||||||
|
directly instead of through the 'parent' proxy of the matching ACL entry,
|
||||||
|
without any error. If the parent proxy is the only sanctioned path to the
|
||||||
|
network, this silently bypasses it. Use 'cache' instead. 'parent ... extip'
|
||||||
|
is the only redirection which survives, and only if 'ext' is a part of the
|
||||||
|
'authcache' key.
|
||||||
|
<li>The destination of every datagram of a SOCKSv5 UDP association is
|
||||||
|
authorized, but only with the default '-U3' (or '-U2') of the 'socks' service.
|
||||||
|
With '-U0' or '-U1' only the first destination of an association is authorized,
|
||||||
|
so ACLs limiting the destination do not restrict the rest of the association.
|
||||||
<li>Immediately report all service crashes to the developers.
|
<li>Immediately report all service crashes to the developers.
|
||||||
<li>Participate in code audit :)
|
<li>Participate in code audit :)
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
+4
-6
@@ -1,4 +1,4 @@
|
|||||||
.TH 3proxy "8" "January 2019" "3proxy 0.9" "Universal proxy server"
|
.TH 3proxy "8" "May 2026" "3proxy 0.9" "Universal proxy server"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.B 3proxy
|
.B 3proxy
|
||||||
\- 3[APA3A] tiny proxy server, or trivial proxy server, or free proxy
|
\- 3[APA3A] tiny proxy server, or trivial proxy server, or free proxy
|
||||||
@@ -29,6 +29,7 @@ from the configuration file like an independent service
|
|||||||
.BR proxy (8)
|
.BR proxy (8)
|
||||||
.BR socks (8)
|
.BR socks (8)
|
||||||
.BR pop3p (8)
|
.BR pop3p (8)
|
||||||
|
.BR imapp (8)
|
||||||
.BR tcppm (8)
|
.BR tcppm (8)
|
||||||
.BR udppm (8)
|
.BR udppm (8)
|
||||||
.BR ftppr (8)
|
.BR ftppr (8)
|
||||||
@@ -140,12 +141,9 @@ configuration file
|
|||||||
Report all bugs to
|
Report all bugs to
|
||||||
.BR 3proxy@3proxy.org
|
.BR 3proxy@3proxy.org
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
3proxy.cfg(3), proxy(8), ftppr(8), socks(8), pop3p(8), tcppm(8), udppm(8),
|
3proxy.cfg(5), proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8), udppm(8),
|
||||||
kill(1), syslogd(8),
|
kill(1), syslogd(8),
|
||||||
.br
|
.br
|
||||||
https://3proxy.org/
|
https://3proxy.org/
|
||||||
.SH TRIVIA
|
|
||||||
3APA3A is pronounced as \`\`zaraza\'\'.
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
3proxy is designed by Vladimir 3APA3A Dubrovin
|
3proxy is designed by Vladimir Dubrovin <vlad@3proxy.org>
|
||||||
.RI ( 3proxy@3proxy.org )
|
|
||||||
Loaded 100 of 204 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user