2014-04-08 17:03:21 +08:00
|
|
|
/*
|
|
|
|
3APA3A simpliest proxy server
|
|
|
|
(c) 2002-2008 by ZARAZA <3APA3A@security.nnov.ru>
|
|
|
|
|
|
|
|
please read License Agreement
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "proxy.h"
|
|
|
|
|
|
|
|
#ifndef PORTMAP
|
|
|
|
#define PORTMAP
|
|
|
|
#endif
|
|
|
|
#define RETURN(xxx) { param->res = xxx; goto CLEANRET; }
|
|
|
|
|
|
|
|
void * tcppmchild(struct clientparam* param) {
|
|
|
|
int res;
|
|
|
|
|
|
|
|
if(!param->hostname)parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport));
|
|
|
|
param->operation = CONNECT;
|
|
|
|
res = (*param->srv->authfunc)(param);
|
|
|
|
if(res) {RETURN(res);}
|
2016-12-19 07:56:23 +08:00
|
|
|
RETURN (mapsocket(param, conf.timeouts[CONNECTION_L]));
|
2014-04-08 17:03:21 +08:00
|
|
|
CLEANRET:
|
|
|
|
|
|
|
|
(*param->srv->logfunc)(param, NULL);
|
|
|
|
freeparam(param);
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef WITHMAIN
|
|
|
|
struct proxydef childdef = {
|
|
|
|
tcppmchild,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
S_TCPPM,
|
2016-12-19 07:56:23 +08:00
|
|
|
" -s use splice() (Fast proxying but no filtering)\n"
|
2014-04-08 17:03:21 +08:00
|
|
|
};
|
|
|
|
#include "proxymain.c"
|
|
|
|
#endif
|