Browse Source

add auth to config

pull/410/head
Max Lv 9 years ago
parent
commit
901457859c
6 changed files with 15 additions and 0 deletions
  1. 2
      src/jconf.c
  2. 1
      src/jconf.h
  3. 3
      src/local.c
  4. 3
      src/redir.c
  5. 3
      src/server.c
  6. 3
      src/tunnel.c

2
src/jconf.c

@ -188,6 +188,8 @@ jconf_t *read_jconf(const char * file)
conf.timeout = to_string(value);
} else if (strcmp(name, "fast_open") == 0) {
conf.fast_open = value->u.boolean;
} else if (strcmp(name, "auth") == 0) {
conf.auth = value->u.boolean;
} else if (strcmp(name, "nofile") == 0) {
conf.nofile = value->u.integer;
} else if (strcmp(name, "nameserver") == 0) {

1
src/jconf.h

@ -50,6 +50,7 @@ typedef struct {
char *password;
char *method;
char *timeout;
int auth;
int fast_open;
int nofile;
char *nameserver;

3
src/local.c

@ -1042,6 +1042,9 @@ int main(int argc, char **argv)
if (timeout == NULL) {
timeout = conf->timeout;
}
if (auth == 0) {
auth = conf->auth;
}
if (fast_open == 0) {
fast_open = conf->fast_open;
}

3
src/redir.c

@ -719,6 +719,9 @@ int main(int argc, char **argv)
if (timeout == NULL) {
timeout = conf->timeout;
}
if (auth == 0) {
auth = conf->auth;
}
}
if (remote_num == 0 || remote_port == NULL ||

3
src/server.c

@ -1343,6 +1343,9 @@ int main(int argc, char **argv)
if (timeout == NULL) {
timeout = conf->timeout;
}
if (auth == 0) {
auth = conf->auth;
}
#ifdef TCP_FASTOPEN
if (fast_open == 0) {
fast_open = conf->fast_open;

3
src/tunnel.c

@ -784,6 +784,9 @@ int main(int argc, char **argv)
if (timeout == NULL) {
timeout = conf->timeout;
}
if (auth == 0) {
auth = conf->auth;
}
}
if (remote_num == 0 || remote_port == NULL || tunnel_addr_str == NULL ||

Loading…
Cancel
Save