|
| 1 | +## Conf |
| 2 | + |
| 3 | +you could see this all at common/settings/conf/conf.go |
| 4 | + |
| 5 | +### client |
| 6 | + |
| 7 | +```json |
| 8 | +{ |
| 9 | + "dns": { |
| 10 | + "hosts":[ |
| 11 | + { |
| 12 | + "domain": "dns.google", |
| 13 | + "ips6": [ |
| 14 | + "2001:4860:4860::8888" |
| 15 | + ], |
| 16 | + "ips4": [ |
| 17 | + "8.8.8.8" |
| 18 | + ] |
| 19 | + } |
| 20 | + ], |
| 21 | + "fake":[ |
| 22 | + { |
| 23 | + "tag": "fakedns", |
| 24 | + "cidr6": "fc00::/18", |
| 25 | + "cidr4": "198.18.0.0/15" |
| 26 | + } |
| 27 | + ], |
| 28 | + "doh":[ |
| 29 | + { |
| 30 | + "tag": "dohdns", |
| 31 | + "url": "https://dns.google/dns-query" |
| 32 | + } |
| 33 | + ] |
| 34 | + }, |
| 35 | + "inbounds": { |
| 36 | + "http": [ |
| 37 | + { |
| 38 | + "tag": "http", |
| 39 | + "network": [ |
| 40 | + "tcp" |
| 41 | + ], |
| 42 | + "listen": "127.0.0.1:1080" |
| 43 | + } |
| 44 | + ], |
| 45 | + "socks": [ |
| 46 | + { |
| 47 | + "tag": "socks", |
| 48 | + "network": [ |
| 49 | + "tcp", |
| 50 | + "udp" |
| 51 | + ], |
| 52 | + "listen": "127.0.0.1:1080" |
| 53 | + } |
| 54 | + ], |
| 55 | + "tun": [ |
| 56 | + { |
| 57 | + "tag": "tun", |
| 58 | + "network": [ |
| 59 | + "tcp", |
| 60 | + "udp" |
| 61 | + ] |
| 62 | + } |
| 63 | + ] |
| 64 | + }, |
| 65 | + "outbounds": { |
| 66 | + "block": [ |
| 67 | + { |
| 68 | + "tag": "block" |
| 69 | + } |
| 70 | + ], |
| 71 | + "dns": [ |
| 72 | + { |
| 73 | + "tag": "dns" |
| 74 | + } |
| 75 | + ], |
| 76 | + "freedom": [ |
| 77 | + { |
| 78 | + "tag": "freedom" |
| 79 | + } |
| 80 | + ], |
| 81 | + "http": [ |
| 82 | + { |
| 83 | + "tag": "http", |
| 84 | + "target": "1.2.3.4:0", |
| 85 | + "mux": false/true |
| 86 | + } |
| 87 | + ], |
| 88 | + "shadowsocks": [ |
| 89 | + { |
| 90 | + "tag": "shadowsocks", |
| 91 | + "target": "1.2.3.4:0", |
| 92 | + "user": { |
| 93 | + "security": "aes_128_gcm/aes_256_gcm/..", |
| 94 | + "password": "password" |
| 95 | + }, |
| 96 | + "tcp": { |
| 97 | + "tls": { |
| 98 | + "serverName": "domain" |
| 99 | + } |
| 100 | + }, |
| 101 | + "mux": false/true |
| 102 | + } |
| 103 | + ], |
| 104 | + "socks": [ |
| 105 | + { |
| 106 | + "tag": "socks", |
| 107 | + "target": "1.2.3.4:0", |
| 108 | + "mux": false/true |
| 109 | + } |
| 110 | + ], |
| 111 | + "trojan": [ |
| 112 | + { |
| 113 | + "tag": "trojan", |
| 114 | + "target": "1.2.3.4:0", |
| 115 | + "user": { |
| 116 | + "password": "password" |
| 117 | + }, |
| 118 | + "tcp": { |
| 119 | + "tls": { |
| 120 | + "serverName": "domain" |
| 121 | + } |
| 122 | + }, |
| 123 | + "mux": false/true |
| 124 | + } |
| 125 | + ], |
| 126 | + "vmess": [ |
| 127 | + { |
| 128 | + "tag": "vmess", |
| 129 | + "target": "1.2.3.4:0", |
| 130 | + "user": { |
| 131 | + "security": "auto/..", |
| 132 | + "uuid": "uuid" |
| 133 | + }, |
| 134 | + "tcp": { |
| 135 | + "tls": { |
| 136 | + "serverName": "domain" |
| 137 | + } |
| 138 | + }, |
| 139 | + "mux": false/true |
| 140 | + } |
| 141 | + ] |
| 142 | + }, |
| 143 | + "rules": { |
| 144 | + "dns": [ |
| 145 | + { |
| 146 | + "condition": [ |
| 147 | + { |
| 148 | + "name": "domains", |
| 149 | + "length": "full/sub/regex", |
| 150 | + "string": [ |
| 151 | + "dns.google/google/goo.*" |
| 152 | + ] |
| 153 | + }, |
| 154 | + { |
| 155 | + "name": "inboundTag", |
| 156 | + "length": "full/sub/regex", |
| 157 | + "string": [ |
| 158 | + "tun-in/tun/tun.*" |
| 159 | + ] |
| 160 | + } |
| 161 | + ], |
| 162 | + "outboundTag": "fake/doh/.." |
| 163 | + } |
| 164 | + ], |
| 165 | + "outbound": [ |
| 166 | + { |
| 167 | + "condition": [ |
| 168 | + { |
| 169 | + "name": "srcNetwork/dstNetwork", |
| 170 | + "length": "full", |
| 171 | + "string": [ |
| 172 | + "tcp/udp" |
| 173 | + ] |
| 174 | + }, |
| 175 | + { |
| 176 | + "name": "srcIP/dstIP", |
| 177 | + "length": "full", |
| 178 | + "string": [ |
| 179 | + "1.2.3.4", |
| 180 | + "geoip:private/.." |
| 181 | + ] |
| 182 | + }, |
| 183 | + { |
| 184 | + "name": "dstDomain", |
| 185 | + "length": "full/sub/regex", |
| 186 | + "string": [ |
| 187 | + "dns.google/google/goo.*" |
| 188 | + ] |
| 189 | + }, |
| 190 | + { |
| 191 | + "name": "srcPort/dstPort", |
| 192 | + "length": "full", |
| 193 | + "string": [ |
| 194 | + "53" |
| 195 | + ] |
| 196 | + }, |
| 197 | + { |
| 198 | + "name": "inboundTag", |
| 199 | + "length": "full/sub/regex", |
| 200 | + "string": [ |
| 201 | + "tun-in/tun/tun.*" |
| 202 | + ] |
| 203 | + } |
| 204 | + ], |
| 205 | + "outboundTag": "http/socks/.." |
| 206 | + } |
| 207 | + ] |
| 208 | + } |
| 209 | +} |
| 210 | +``` |
| 211 | + |
| 212 | +### server |
| 213 | + |
| 214 | +```json |
| 215 | +{ |
| 216 | + "inbounds": { |
| 217 | + "shadowsocks": [ |
| 218 | + { |
| 219 | + "tag": "shadowsocks", |
| 220 | + "network": [ |
| 221 | + "tcp", |
| 222 | + "udp" |
| 223 | + ], |
| 224 | + "listen": "127.0.0.1:1080", |
| 225 | + "user": { |
| 226 | + "security": "aes_128_gcm/aes_256_gcm/..", |
| 227 | + "password": "password" |
| 228 | + }, |
| 229 | + "tcp": { |
| 230 | + "tls": { |
| 231 | + "serverName": "domain", |
| 232 | + "certificate": "certificate", |
| 233 | + "key": "key" |
| 234 | + } |
| 235 | + }, |
| 236 | + "mux": false/true |
| 237 | + } |
| 238 | + ], |
| 239 | + "vmess": [ |
| 240 | + { |
| 241 | + "tag": "vmess", |
| 242 | + "network": [ |
| 243 | + "tcp", |
| 244 | + "udp" |
| 245 | + ], |
| 246 | + "listen": "127.0.0.1:1080", |
| 247 | + "user": { |
| 248 | + "uuid": "uuid" |
| 249 | + }, |
| 250 | + "tcp": { |
| 251 | + "tls": { |
| 252 | + "serverName": "domain", |
| 253 | + "certificate": "certificate", |
| 254 | + "key": "key" |
| 255 | + } |
| 256 | + }, |
| 257 | + "mux": false/true |
| 258 | + } |
| 259 | + ] |
| 260 | + }, |
| 261 | + "outbounds": { |
| 262 | + "freedom": [ |
| 263 | + { |
| 264 | + "tag": "freedom" |
| 265 | + } |
| 266 | + ] |
| 267 | + }, |
| 268 | + "rules": { |
| 269 | + "outbounds": [ |
| 270 | + { |
| 271 | + "condition": [ |
| 272 | + { |
| 273 | + "name": "srcNetwork", |
| 274 | + "length": "full", |
| 275 | + "string": [ |
| 276 | + "tcp", |
| 277 | + "udp" |
| 278 | + ] |
| 279 | + } |
| 280 | + ], |
| 281 | + "outboundTag": "freddom" |
| 282 | + } |
| 283 | + ] |
| 284 | + } |
| 285 | +} |
| 286 | +``` |
0 commit comments