2014-04-08 17:03:21 +08:00
|
|
|
/*
|
|
|
|
3APA3A simpliest proxy server
|
2016-12-20 20:47:02 +08:00
|
|
|
(c) 2002-2016 by Vladimir Dubrovin <3proxy@3proxy.ru>
|
2014-04-08 17:03:21 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-10-17 04:13:07 +08:00
|
|
|
if(!param->hostname && parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport))) RETURN(100);
|
2014-04-08 17:03:21 +08:00
|
|
|
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:
|
|
|
|
|
2020-10-09 20:42:34 +08:00
|
|
|
dolog(param, param->hostname);
|
2014-04-08 17:03:21 +08:00
|
|
|
freeparam(param);
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef WITHMAIN
|
|
|
|
struct proxydef childdef = {
|
|
|
|
tcppmchild,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
S_TCPPM,
|
2019-06-20 16:19:58 +08:00
|
|
|
""
|
2014-04-08 17:03:21 +08:00
|
|
|
};
|
|
|
|
#include "proxymain.c"
|
2020-10-14 21:10:35 +08:00
|
|
|
#include "log.c"
|
2014-04-08 17:03:21 +08:00
|
|
|
#endif
|