Browse Source

support ipv6_first option in config file (#946)

pull/947/head
Rayson Zhu 8 years ago
committed by Max Lv
parent
commit
d1765df9f9
4 changed files with 8 additions and 1 deletions
  1. 3
      doc/shadowsocks-libev.asciidoc
  2. 2
      src/jconf.c
  3. 1
      src/jconf.h
  4. 3
      src/server.c

3
doc/shadowsocks-libev.asciidoc

@ -160,12 +160,13 @@ The config file equivalent of command line options is listed as example below.
| -s some.server.net -p 1234 (client) | "server": "some.server.net:1234" | -s some.server.net -p 1234 (client) | "server": "some.server.net:1234"
| -p 1234 -k "PasSworD" (server) | "port_password": {"1234":"PasSworD"} | -p 1234 -k "PasSworD" (server) | "port_password": {"1234":"PasSworD"}
| -p 1234 | "server_port": "1234" | -p 1234 | "server_port": "1234"
| -b 0.0.0.0 | "local_adress": "0.0.0.0"
| -b 0.0.0.0 | "local_address": "0.0.0.0"
| -l 4321 | "local_port": "4321" | -l 4321 | "local_port": "4321"
| -k "PasSworD" | "password": "PasSworD" | -k "PasSworD" | "password": "PasSworD"
| -m "aes-256-cfb" | "method": "aes-256-cfb" | -m "aes-256-cfb" | "method": "aes-256-cfb"
| -t 60 | "timeout": 60 | -t 60 | "timeout": 60
| --fast-open | "fast_open": true | --fast-open | "fast_open": true
| -6 | "ipv6_first": true
| -A | "auth": true | -A | "auth": true
| -n "/etc/nofile" | "nofile": "/etc/nofile" | -n "/etc/nofile" | "nofile": "/etc/nofile"
| -d "8.8.8.8" | "nameserver": "8.8.8.8" | -d "8.8.8.8" | "nameserver": "8.8.8.8"

2
src/jconf.c

@ -216,6 +216,8 @@ read_jconf(const char *file)
conf.mtu = value->u.integer; conf.mtu = value->u.integer;
} else if (strcmp(name, "mptcp") == 0) { } else if (strcmp(name, "mptcp") == 0) {
conf.mptcp = value->u.boolean; conf.mptcp = value->u.boolean;
} else if (strcmp(name, "ipv6_first") == 0) {
conf.ipv6_first = value->u.boolean;
} }
} }
} else { } else {

1
src/jconf.h

@ -63,6 +63,7 @@ typedef struct {
int mode; int mode;
int mtu; int mtu;
int mptcp; int mptcp;
int ipv6_first;
} jconf_t; } jconf_t;
jconf_t *read_jconf(const char *file); jconf_t *read_jconf(const char *file);

3
src/server.c

@ -1715,6 +1715,9 @@ main(int argc, char **argv)
if (conf->nameserver != NULL) { if (conf->nameserver != NULL) {
nameservers[nameserver_num++] = conf->nameserver; nameservers[nameserver_num++] = conf->nameserver;
} }
if (ipv6first == 0) {
ipv6first = conf->ipv6_first;
}
} }
if (server_num == 0) { if (server_num == 0) {

Loading…
Cancel
Save