mirror of
https://github.com/3proxy/3proxy.git
synced 2026-08-13 12:19:17 +08:00
fix: allow extip parents without a port
This commit is contained in:
parent
6ab12d88ca
commit
4bf9eecddf
@ -817,7 +817,7 @@ with probability of 0.7) for outgoing web connections. Chains are only applied t
|
||||
.br
|
||||
type is one of:
|
||||
.br
|
||||
\fBextip\fR does not actually redirect the request; it sets the external address for this request to \fI<ip>\fR. It can be chained with another parent type. It's useful to set the external IP based on ACL or make it random. When built with \fBWITH_LOCAL_PORT_RANGE\fR on Linux 6.3 or newer, \fI<port>\fR may be an inclusive IPv4 local port range \fIFIRST-LAST\fR. The range is applied to outgoing sockets for requests matching this parent; DNS resolver traffic is not affected. For example, \fBparent 1000 extip 192.0.2.10 20000-30000\fR.
|
||||
\fBextip\fR does not actually redirect the request; it sets the external address for this request to \fI<ip>\fR. It can be chained with another parent type. It's useful to set the external IP based on ACL or make it random. Its \fI<port>\fR argument is optional and defaults to 0. When built with \fBWITH_LOCAL_PORT_RANGE\fR on Linux 6.3 or newer, \fI<port>\fR may be an inclusive IPv4 local port range \fIFIRST-LAST\fR. The range is applied to outgoing sockets for requests matching this parent; DNS resolver traffic is not affected. For example, \fBparent 1000 extip 192.0.2.10 20000-30000\fR.
|
||||
.br
|
||||
\fBtcp\fR simply redirect connection. TCP is always last in chain. This type of proxy is a simple TCP redirection, it does not support parent authentication.
|
||||
.br
|
||||
|
||||
@ -814,6 +814,11 @@ static int h_parent(int argc, unsigned char **argv){
|
||||
free(chains);
|
||||
return(4);
|
||||
}
|
||||
if(argc < 5 && chains->type != R_EXTIP) {
|
||||
fprintf(stderr, "Chaining error: port is required for parent type %s\n", argv[2]);
|
||||
free(chains);
|
||||
return(3);
|
||||
}
|
||||
#ifdef WITH_UN
|
||||
if(!strncmp((char *)argv[3], "unix:", 5)){
|
||||
make_un(argv[3] + 5, (struct sockaddr_un*)&chains->addr);
|
||||
@ -838,7 +843,7 @@ static int h_parent(int argc, unsigned char **argv){
|
||||
*cidr = '/';
|
||||
chains->cidr = atoi(cidr + 1);
|
||||
}
|
||||
{
|
||||
if(argc > 4) {
|
||||
char *end;
|
||||
unsigned long port;
|
||||
|
||||
@ -1723,7 +1728,7 @@ struct commands commandhandlers[]={
|
||||
{NULL, "system", h_system, 2, 2},
|
||||
{NULL, "pidfile", h_pidfile, 2, 2},
|
||||
{NULL, "monitor", h_monitor, 2, 2},
|
||||
{NULL, "parent", h_parent, 5, 0},
|
||||
{NULL, "parent", h_parent, 4, 0},
|
||||
{NULL, "allow", h_ace, 1, 0},
|
||||
{NULL, "deny", h_ace, 1, 0},
|
||||
{NULL, "redirect", h_ace, 3, 0},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user