diff --git a/src/jconf.c b/src/jconf.c index f1a14d9a..72c915af 100644 --- a/src/jconf.c +++ b/src/jconf.c @@ -137,6 +137,10 @@ jconf_t *read_jconf(const char* file) { conf.remote_port = to_string(value); } + else if (strcmp(name, "local") == 0) + { + conf.local_addr = to_string(value); + } else if (strcmp(name, "local_port") == 0) { conf.local_port = to_string(value); diff --git a/src/jconf.h b/src/jconf.h index ca99142e..2a9e9bba 100644 --- a/src/jconf.h +++ b/src/jconf.h @@ -17,6 +17,7 @@ typedef struct int remote_num; remote_addr_t remote_addr[MAX_REMOTE_NUM]; char *remote_port; + char *local_addr; char *local_port; char *password; char *method; diff --git a/src/local.c b/src/local.c index 052a5ffb..b28020e6 100644 --- a/src/local.c +++ b/src/local.c @@ -876,6 +876,7 @@ int main (int argc, char **argv) } } if (remote_port == NULL) remote_port = conf->remote_port; + if (local_addr == NULL) local_addr = conf->local_addr; if (local_port == NULL) local_port = conf->local_port; if (password == NULL) password = conf->password; if (method == NULL) method = conf->method; diff --git a/src/redir.c b/src/redir.c index abeda551..b674b5ad 100644 --- a/src/redir.c +++ b/src/redir.c @@ -729,6 +729,7 @@ int main (int argc, char **argv) } } if (remote_port == NULL) remote_port = conf->remote_port; + if (local_addr == NULL) local_addr = conf->local_addr; if (local_port == NULL) local_port = conf->local_port; if (password == NULL) password = conf->password; if (method == NULL) method = conf->method;