Compare commits

...
Author SHA1 Message Date
z3APA3A 79170af2bc publish as 0.8.3 2016-01-26 12:10:55 +03:00
z3APA3A 331c933508 publish as 0.8.3 2016-01-25 22:55:08 +03:00
z3APA3A d1334e5157 Merge remote-tracking branch 'refs/remotes/origin/devel'
# Conflicts:
#	src/version.h
2016-01-25 15:06:42 +03:00
z3APA3A fec0da52af fixed: use SASIZE() instead of sizeof() in connect() for FreeBSD compatibility 2016-01-25 14:49:17 +03:00
z3APA3A 7a7cd9bc25 README updated 2016-01-23 20:44:01 +03:00
z3APA3A bb8e5832eb update README 2016-01-23 20:38:10 +03:00
z3APA3A c2a7fdc2a2 release as devel 2016-01-23 19:26:20 +03:00
z3APA3A 3cbbe1aef7 publish as 0.8.2 2016-01-23 19:17:36 +03:00
z3APA3A 69cb310481 Merge remote-tracking branch 'refs/remotes/origin/devel' 2016-01-23 18:48:28 +03:00
z3APA3A 375a2c9f6e Do not use SO_REUSEADDR by default
to avoid misbehavior in some glibc versions
2016-01-23 18:43:30 +03:00
z3APA3A 1ed5229a54 Do not use SO_REUSEADDR by default
to avoid misbehavior in some glibc versions
2016-01-23 18:41:20 +03:00
z3APA3A d6f29ac6df reset transparent flag on keep-alive connection 2016-01-23 17:16:49 +03:00
z3APA3A 82e76d1d2a Merge remote-tracking branch 'refs/remotes/origin/devel' 2016-01-22 16:20:12 +03:00
z3APA3A 4af5f2fde7 Use SASIZE() instead of sizeof() in bind() for FreeBSD compatibility 2016-01-22 15:59:40 +03:00
z3APA3A 95a07c1b46 minor documentation update 2016-01-21 16:53:38 +03:00
z3APA3A 3a4f3b5cd1 publish as 0.8.1 2016-01-21 16:26:08 +03:00
z3APA3A a6383bbd10 Merge remote-tracking branch 'refs/remotes/origin/devel'
# Conflicts:
#	src/version.h
2016-01-21 15:50:17 +03:00
z3APA3A 359026cb5f !!Fix: destination IP may be not checked against ACL 2016-01-21 15:45:39 +03:00
z3APA3A 5e440b4482 publish as 0.9-devel 2016-01-20 01:04:03 +03:00
12 changed files with 165 additions and 35 deletions

No files matched your search

+106 -3
View File
@@ -7,15 +7,118 @@
Please read doc/html/index.html and man pages.
Features:
1. General
+ HTTP/1.1 Proxy with keep-alive client and server support,
transparent proxy support.
+ Anonymous and random client emulation HTTP proxy mode
+ FTP over HTTP support.
+ DNS caching with built-in resolver
+ HTTPS (CONNECT) proxy
+ SOCKSv4/4.5 Proxy
+ SOCKSv5 Proxy
+ UDP and bind support for SOCKSv5 (fully compatible with
SocksCAP/FreeCAP for UDP)
+ Transparent SOCKS redirection for HTTP, POP3, FTP, SMTP, ICQ
+ POP3 Proxy
+ FTP proxy
+ DNS proxy
+ TCP port mapper
+ UDP port mapper
+ SMTP proxy
+ ICQ/AOL proxy
+ Threaded application (no child process).
+ Web administration and statistics
+ Plugins for functionality extension
+ Native 64 bit application for 64 bit OS, including 64-bit editions of
Windows.
+ IPv6 support
2. Proxy chaining and network connections
+ 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 redirection parent support
+ Random parent selection
+ Chain building (multihop proxing)
+ Load balancing between few network connections by choosing network
interface
3. Logging
+ turnable log format compatible with any log parser
+ stdout logging
+ file logging
+ syslog logging (Unix)
+ ODBC logging
+ log file rotation (hourly, daily, weekly, monthly)
+ automatic log file comperssion with external archiver (for files)
+ automatic removal of older log files
+ Character filtering for log files
+ different log files for different servces are supported
4. Access control
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
combined) bandwith limitation for incoming and (!)outgoing trafic.
+ ACL-driven (user/source/destination/protocol/weekday/daytime or
combined) traffic limitation per day, week or month for incoming and
(!) outgoing traffic
+ User authentication by DNS hostname
+ User authentication by username / password
+ Access control by username, source IP, destination IP, destination
port and destination action (POST, PUT, GET, etc), weekday and daytime.
+ 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).
+ NTLM (v1 only) authentication for HTTP proxy access
+ 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 PCRE) via PCREPlugin
currently HTTP traffic only for URLs, HTTP headers and HTTP data.
+ Authentication with Windows username/password (cleartext only!)
+ SSL/TLS decryptions with certificate spoofing
+ NAT support under Linux
6. Configuration
+ support for configuration files
+ support for includes in configuration files
+ interface binding
+ 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
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)
+ 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
Windows 95/98/NT/2000/XP/2003/Vista
executable or service (supports installation and removal).
It uses config file to read it's configuration (see
3proxy.cfg.sample for details).
--install installs and starts proxy as NT/2000/XP service
--install installs and starts proxy as Windows service
(config file should be located in the same directory)
--remove removes the service (should be stopped before via
net stop 3proxy).
'net stop 3proxy').
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
+1 -1
View File
@@ -114,7 +114,7 @@ parent 1000 http 0.0.0.0 0
allow * * $c:\3proxy\local.nets 80,8080-8088
#allow direct access to local.nets networks
allow * * * 80,8080-8088
parent 1000 http proxy.sandy.ru 3128
parent 1000 http proxy.3proxy.ru 3128
#use parent caching proxy for rest of the networks
allow *
+1 -1
View File
@@ -191,7 +191,7 @@
allow * * $c:\3proxy\local.nets 80,8080-8088
#разрешить прямой web-доступ к сетям из local.nets
allow * * * 80,8080-8088
parent 1000 http proxy.sandy.ru 3128
parent 1000 http proxy.3proxy.ru 3128
#все остальные веб-запросы перенаправить на внешний прокси-сервер
allow *
#разрешить socks-запросы по другим портам</pre>
+8 -6
View File
@@ -323,11 +323,13 @@ int IPInentry(struct sockaddr *sa, struct iplist *ipentry){
unsigned char *ip, *ipf, *ipt;
if(!sa || ! ipentry || *SAFAMILY(sa) != ipentry->family) return 0;
ip = (unsigned char *)SAADDR(sa);
ipf = (unsigned char *)&ipentry->ip_from;
ipt = (unsigned char *)&ipentry->ip_to;
if(!sa || ! ipentry || *SAFAMILY(sa) != ipentry->family) return 0;
addrlen = SAADDRLEN(sa);
if(memcmp(ip,ipf,addrlen) < 0 || memcmp(ip,ipt,addrlen) > 0) return 0;
@@ -353,7 +355,7 @@ int ACLmatches(struct ace* acentry, struct clientparam * param){
}
if(!ipentry) return 0;
}
if((acentry->dst && SAISNULL(&param->req)) || (acentry->dstnames && param->hostname)) {
if((acentry->dst && !SAISNULL(&param->req)) || (acentry->dstnames && param->hostname)) {
for(ipentry = acentry->dst; ipentry; ipentry = ipentry->next)
if(IPInentry((struct sockaddr *)&param->req, ipentry)) {
break;
@@ -1059,19 +1061,19 @@ unsigned long udpresolve(int af, unsigned char * name, unsigned char * value, un
*SAFAMILY(sinsl) = *SAFAMILY(&nservers[i].addr);
}
if((sock=so._socket(SASOCK(sinsl), usetcp?SOCK_STREAM:SOCK_DGRAM, usetcp?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) break;
if(so._bind(sock,sinsl,sizeof(addr))){
if(so._bind(sock,sinsl,SASIZE(sinsl))){
so._shutdown(sock, SHUT_RDWR);
so._closesocket(sock);
break;
}
if(makeauth && !SAISNULL(&authnserver.addr)){
memcpy(sinsr, &authnserver.addr, sizeof(addr));
memcpy(sinsr, &authnserver.addr, sizeof(authnserver.addr));
}
else {
memcpy(sinsr, &nservers[i].addr, sizeof(addr));
memcpy(sinsr, &nservers[i].addr, sizeof(nservers[i].addr));
}
if(usetcp){
if(so._connect(sock,sinsr,sizeof(addr))) {
if(so._connect(sock,sinsr,SASIZE(sinsr))) {
so._shutdown(sock, SHUT_RDWR);
so._closesocket(sock);
break;
+20 -9
View File
@@ -648,7 +648,6 @@ int doconnect(struct clientparam * param){
}
else {
struct linger lg = {1,conf.timeouts[SINGLEBYTE_S]};
int opt = 1;
if(SAISNULL(&param->sinsr)){
if(SAISNULL(&param->req)) {
@@ -660,26 +659,38 @@ int doconnect(struct clientparam * param){
if(!*SAPORT(&param->sinsr))*SAPORT(&param->sinsr) = *SAPORT(&param->req);
if ((param->remsock=so._socket(SASOCK(&param->sinsr), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {return (11);}
so._setsockopt(param->remsock, SOL_SOCKET, SO_LINGER, (unsigned char *)&lg, sizeof(lg));
so._setsockopt(param->remsock, SOL_SOCKET, SO_REUSEADDR, (unsigned char *)&opt, sizeof(int));
#ifdef REUSE
{
int opt;
#ifdef SO_REUSEADDR
opt = 1;
so._setsockopt(param->remsock, SOL_SOCKET, SO_REUSEADDR, (unsigned char *)&opt, sizeof(int));
#endif
#ifdef SO_REUSEPORT
opt = 1;
so._setsockopt(param->remsock, SOL_SOCKET, SO_REUSEPORT, (unsigned char *)&opt, sizeof(int));
#endif
}
#endif
#ifndef NOIPV6
if(*SAFAMILY(&param->sinsr) == AF_INET6) memcpy(&param->sinsl, &param->srv->extsa6, sizeof(param->srv->extsa6));
else
#endif
memcpy(&param->sinsl, &param->srv->extsa, sizeof(param->srv->extsa));
if (param->srv->targetport && !*SAPORT(&param->sinsl) && ntohs(*SAPORT(&param->sincr)) > 1023) *SAPORT(&param->sinsl) = *SAPORT(&param->sincr);
if(so._bind(param->remsock, (struct sockaddr*)&param->sinsl, sizeof(param->sinsl))==-1) {
*SAPORT(&param->sinsl) = 0;
if(so._bind(param->remsock, (struct sockaddr*)&param->sinsl, sizeof(param->sinsl))==-1) {
return 12;
}
*SAPORT(&param->sinsl) = 0;
if(so._bind(param->remsock, (struct sockaddr*)&param->sinsl, SASIZE(&param->sinsl))==-1) {
return 12;
}
if(param->operation >= 256 || (param->operation & CONNECT)){
#ifdef _WIN32
unsigned long ul = 1;
#endif
if(so._connect(param->remsock,(struct sockaddr *)&param->sinsr,sizeof(param->sinsr))) {return (13);}
if(so._connect(param->remsock,(struct sockaddr *)&param->sinsr,SASIZE(&param->sinsr))) {
return (13);
}
param->nconnects++;
#ifdef _WIN32
ioctlsocket(param->remsock, FIONBIO, &ul);
+3 -3
View File
@@ -48,7 +48,7 @@ void * dnsprchild(struct clientparam* param) {
}
ioctlsocket(param->clisock, FIONBIO, &ul);
if(so._setsockopt(param->clisock, SOL_SOCKET, SO_REUSEADDR, (unsigned char *)&ul, sizeof(int))) {RETURN(820);};
if(so._bind(param->clisock,(struct sockaddr *)&param->sincl,sizeof(param->sincl))) {
if(so._bind(param->clisock,(struct sockaddr *)&param->sincl,SASIZE(&param->sincl))) {
RETURN(822);
}
@@ -135,12 +135,12 @@ void * dnsprchild(struct clientparam* param) {
}
memset(&param->sinsl, 0, sizeof(param->sinsl));
*SAFAMILY(&param->sinsl) = *SAFAMILY(&nservers[0].addr);
if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,sizeof(param->sinsl))) {
if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,SASIZE(&param->sinsl))) {
RETURN(819);
}
memcpy(&param->sinsr, &nservers[0].addr, sizeof(param->sinsr));
if(nservers[0].usetcp) {
if(so._connect(param->remsock,(struct sockaddr *)&param->sinsr,sizeof(param->sinsr))) RETURN(830);
if(so._connect(param->remsock,(struct sockaddr *)&param->sinsr,SASIZE(&param->sinsr))) RETURN(830);
buf-=2;
*(unsigned short*)buf = htons(i);
i+=2;
+3 -4
View File
@@ -119,11 +119,11 @@ void * ftpprchild(struct clientparam* param) {
clidatasock = INVALID_SOCKET;
}
if ((clidatasock=socket(SASOCK(&param->sincl), SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
sasize = sizeof(param->sincl);
*SAPORT(&param->sincl) = 0;
if(so._bind(clidatasock, (struct sockaddr *)&param->sincl, sasize)){RETURN(822);}
if(so._bind(clidatasock, (struct sockaddr *)&param->sincl, SASIZE(&param->sincl))){RETURN(822);}
if (pasv) {
if(so._listen(clidatasock, 1)) {RETURN(823);}
sasize = sizeof(param->sincl);
if(so._getsockname(clidatasock, (struct sockaddr *)&param->sincl, &sasize)){RETURN(824);}
if(*SAFAMILY(&param->sincl) == AF_INET)
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
@@ -145,8 +145,7 @@ void * ftpprchild(struct clientparam* param) {
if(sscanf((char *)buf+5, "%lu,%lu,%lu,%lu,%hu,%hu", &b1, &b2, &b3, &b4, &b5, &b6)!=6) {RETURN(828);}
*SAPORT(&param->sincr) = htons((unsigned short)((b5<<8)^b6));
sasize = sizeof(param->sincr);
if(so._connect(clidatasock, (struct sockaddr *)&param->sincr, sasize)) {
if(so._connect(clidatasock, (struct sockaddr *)&param->sincr, SASIZE(&param->sincr))) {
so._closesocket(clidatasock);
clidatasock = INVALID_SOCKET;
RETURN(826);
+1
View File
@@ -293,6 +293,7 @@ for(;;){
RETURN(511);
}
if(buf[i-3] == '1') keepalive = 2;
param->transparent = 0;
if((isconnect = !strncasecmp((char *)buf, "CONNECT", 7))) keepalive = 2;
if ((sb=(unsigned char *)(unsigned char *)strchr((char *)buf, ' ')) == NULL) {RETURN(512);}
+3 -3
View File
@@ -444,7 +444,7 @@ int MODULEMAINFUNC (int argc, char** argv){
#endif
}
size = sizeof(srv.intsa);
for(sleeptime = SLEEPTIME * 100; so._bind(sock, (struct sockaddr*)&srv.intsa, size)==-1; usleep(sleeptime)) {
for(sleeptime = SLEEPTIME * 100; so._bind(sock, (struct sockaddr*)&srv.intsa, SASIZE(&srv.intsa))==-1; usleep(sleeptime)) {
sprintf((char *)buf, "bind(): %s", strerror(errno));
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
sleeptime = (sleeptime<<1);
@@ -481,7 +481,7 @@ int MODULEMAINFUNC (int argc, char** argv){
so._setsockopt(srv.cbsock, SOL_SOCKET, SO_REUSEPORT, (unsigned char *)&opt, sizeof(int));
#endif
if(so._bind(srv.cbsock, (struct sockaddr*)&cbsa, sizeof(cbsa))==-1) {
if(so._bind(srv.cbsock, (struct sockaddr*)&cbsa, SASIZE(&cbsa))==-1) {
(*srv.logfunc)(&defparam, "Failed to bind connect back socket");
return -7;
}
@@ -530,7 +530,7 @@ int MODULEMAINFUNC (int argc, char** argv){
new_sock=so._socket(SASOCK(&defparam.sincr), SOCK_STREAM, IPPROTO_TCP);
if(new_sock != INVALID_SOCKET){
parsehost(srv.family, cbc_string, (struct sockaddr *)&defparam.sincr);
if(so._connect(new_sock,(struct sockaddr *)&defparam.sincr,sizeof(defparam.sincr))) {
if(so._connect(new_sock,(struct sockaddr *)&defparam.sincr,SASIZE(&defparam.sincr))) {
so._closesocket(new_sock);
new_sock = INVALID_SOCKET;
usleep(SLEEPTIME);
+15 -1
View File
@@ -179,6 +179,20 @@ void * sockschild(struct clientparam* param) {
#endif
if ((param->remsock=so._socket(SASOCK(&param->req), command == 2? SOCK_STREAM:SOCK_DGRAM, command == 2?IPPROTO_TCP:IPPROTO_UDP)) == INVALID_SOCKET) {RETURN (11);}
param->operation = command == 2?BIND:UDPASSOC;
#ifdef REUSE
if (command == 2){
int opt;
#ifdef SO_REUSEADDR
opt = 1;
so._setsockopt(param->remsock, SOL_SOCKET, SO_REUSEADDR, (unsigned char *)&opt, sizeof(int));
#endif
#ifdef SO_REUSEPORT
opt = 1;
so._setsockopt(param->remsock, SOL_SOCKET, SO_REUSEPORT, (unsigned char *)&opt, sizeof(int));
#endif
}
#endif
break;
default:
@@ -206,7 +220,7 @@ fflush(stderr);
if(param->clisock == INVALID_SOCKET) {RETURN(11);}
memcpy(&sin, &param->sincl, sizeof(&sin));
*SAPORT(&sin) = 0;
if(so._bind(param->clisock,(struct sockaddr *)&sin,sizeof(sin))) {RETURN (12);}
if(so._bind(param->clisock,(struct sockaddr *)&sin,SASIZE(&sin))) {RETURN (12);}
#if SOCKSTRACE > 0
fprintf(stderr, "%hu binded to communicate with client\n",
ntohs(*SAPORT(&sin))
+2 -2
View File
@@ -63,7 +63,7 @@ void * udppmchild(struct clientparam* param) {
ioctlsocket(param->clisock, FIONBIO, &ul);
size = sizeof(param->sinsl);
if(so._getsockname(param->srv->srvsock, (struct sockaddr *)&param->sinsl, &size)) {RETURN(21);};
if(so._bind(param->clisock,(struct sockaddr *)&param->sinsl,sizeof(struct sockaddr_in))) {
if(so._bind(param->clisock,(struct sockaddr *)&param->sinsl,SASIZE(&param->sinsl))) {
RETURN(822);
}
#else
@@ -77,7 +77,7 @@ void * udppmchild(struct clientparam* param) {
#endif
*SAPORT(&param->sinsl) = 0;
if ((param->remsock=so._socket(SASOCK(&param->sinsl), SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET) {RETURN (11);}
if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,sizeof(param->sinsl))) {RETURN (12);}
if(so._bind(param->remsock,(struct sockaddr *)&param->sinsl,SASIZE(&param->sinsl))) {RETURN (12);}
#ifdef _WIN32
ioctlsocket(param->remsock, FIONBIO, &ul);
#else
+2 -2
View File
@@ -1,2 +1,2 @@
#define VERSION "3proxy-0.8.0"
#define BUILDDATE "160120012001"
#define VERSION "3proxy-0.8.3"
#define BUILDDATE "160126120751"