mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
-Xftp flag for http proxy
This commit is contained in:
1 parent
f271a57238
commit
d4eaf5acc8
5 files changed
+22
-1
No files matched your search
@@ -187,6 +187,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
||||
childdef.port = 3128;
|
||||
childdef.isudp = 0;
|
||||
childdef.service = S_PROXY;
|
||||
#ifdef WITH_FTP
|
||||
childdef.helpmessage = " -Xftp - fetch ftp:// URLs\n";
|
||||
#endif
|
||||
#ifdef NOIPV6
|
||||
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.poolsize)){
|
||||
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum);
|
||||
|
||||
@@ -387,6 +387,7 @@ for(;;){
|
||||
}
|
||||
#ifdef WITH_FTP
|
||||
else if (!strncasecmp((char *)sb, "ftp://", 6)) {
|
||||
if(!param->srv->allowftp) RETURN(513);
|
||||
ftp = 1;
|
||||
sb += 6;
|
||||
}
|
||||
@@ -1357,6 +1358,9 @@ struct proxydef childdef = {
|
||||
S_PROXY,
|
||||
"-a - anonymous proxy\r\n"
|
||||
"-a1 - anonymous proxy with random client IP spoofing\r\n"
|
||||
#ifdef WITH_FTP
|
||||
"-Xftp - fetch ftp:// URLs\r\n"
|
||||
#endif
|
||||
};
|
||||
#include "proxymain.c"
|
||||
#endif
|
||||
@@ -584,6 +584,12 @@ int MODULEMAINFUNC (int argc, char** argv){
|
||||
if(!strncasecmp(argv[i]+2, "imap", 4)) srv.srvstarttls = S_IMAPP;
|
||||
else if(!strncasecmp(argv[i]+2, "pop3", 4)) srv.srvstarttls = S_POP3P;
|
||||
else if(!strncasecmp(argv[i]+2, "smtp", 4)) srv.srvstarttls = S_SMTPP;
|
||||
#ifdef WITH_FTP
|
||||
/* The http proxy fetches ftp:// only where it was asked to:
|
||||
the protocol brings a second connection and a listing to
|
||||
build, which a service serving http has no use for. */
|
||||
else if(!strncasecmp(argv[i]+2, "ftp", 3)) srv.allowftp = 1;
|
||||
#endif
|
||||
else error = 1;
|
||||
break;
|
||||
case 'F':
|
||||
|
||||
@@ -618,6 +618,7 @@ struct srvparam {
|
||||
int haproxy;
|
||||
int nostarttls;
|
||||
PROXYSERVICE srvstarttls;
|
||||
int allowftp; /* the http proxy fetches ftp:// for this service */
|
||||
uint32_t fakeip;
|
||||
unsigned char fakeip6[16];
|
||||
#ifdef WITHSPLICE
|
||||
|
||||
Reference in new issue
Block a user