Skip to content

Commit 9014578

Browse files
committed
add auth to config
1 parent 04c5f97 commit 9014578

File tree

6 files changed

+15
-0
lines changed

6 files changed

+15
-0
lines changed

src/jconf.c

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ jconf_t *read_jconf(const char * file)
188188
conf.timeout = to_string(value);
189189
} else if (strcmp(name, "fast_open") == 0) {
190190
conf.fast_open = value->u.boolean;
191+
} else if (strcmp(name, "auth") == 0) {
192+
conf.auth = value->u.boolean;
191193
} else if (strcmp(name, "nofile") == 0) {
192194
conf.nofile = value->u.integer;
193195
} else if (strcmp(name, "nameserver") == 0) {

src/jconf.h

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef struct {
5050
char *password;
5151
char *method;
5252
char *timeout;
53+
int auth;
5354
int fast_open;
5455
int nofile;
5556
char *nameserver;

src/local.c

+3
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,9 @@ int main(int argc, char **argv)
10421042
if (timeout == NULL) {
10431043
timeout = conf->timeout;
10441044
}
1045+
if (auth == 0) {
1046+
auth = conf->auth;
1047+
}
10451048
if (fast_open == 0) {
10461049
fast_open = conf->fast_open;
10471050
}

src/redir.c

+3
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ int main(int argc, char **argv)
719719
if (timeout == NULL) {
720720
timeout = conf->timeout;
721721
}
722+
if (auth == 0) {
723+
auth = conf->auth;
724+
}
722725
}
723726

724727
if (remote_num == 0 || remote_port == NULL ||

src/server.c

+3
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,9 @@ int main(int argc, char **argv)
13431343
if (timeout == NULL) {
13441344
timeout = conf->timeout;
13451345
}
1346+
if (auth == 0) {
1347+
auth = conf->auth;
1348+
}
13461349
#ifdef TCP_FASTOPEN
13471350
if (fast_open == 0) {
13481351
fast_open = conf->fast_open;

src/tunnel.c

+3
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,9 @@ int main(int argc, char **argv)
784784
if (timeout == NULL) {
785785
timeout = conf->timeout;
786786
}
787+
if (auth == 0) {
788+
auth = conf->auth;
789+
}
787790
}
788791

789792
if (remote_num == 0 || remote_port == NULL || tunnel_addr_str == NULL ||

0 commit comments

Comments
 (0)