Skip to content

Commit

Permalink
improve: permit tcp proxy's remote_port == 0
Browse files Browse the repository at this point in the history
Signed-off-by: Dengfeng Liu <liudf0716@gmail.com>
  • Loading branch information
liudf0716 committed Oct 24, 2024
1 parent e0902f6 commit 3e9c465
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ validate_proxy(struct proxy_service *ps)
return 0;
}
} else if (strcmp(ps->proxy_type, "tcp") == 0 || strcmp(ps->proxy_type, "udp") == 0) {
if (ps->remote_port == 0 || ps->local_port == 0 || ps->local_ip == NULL) {
debug(LOG_ERR, "Proxy [%s] error: remote_port or local_port or local_ip not found", ps->proxy_name);
if (ps->local_port == 0 || ps->local_ip == NULL) {
debug(LOG_ERR, "Proxy [%s] error: local_port or local_ip not found", ps->proxy_name);
return 0;
}
} else if (strcmp(ps->proxy_type, "http") == 0 || strcmp(ps->proxy_type, "https") == 0) {
Expand Down

0 comments on commit 3e9c465

Please sign in to comment.