mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-25 10:13:44 +00:00
Merge pull request #27 from guizai/master
Add local bind address config
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user