imgk / shadow

A rule-based transparent proxy for Windows, Linux, macOS
GNU General Public License v3.0
196 stars 43 forks source link

use wintun,how to "global proxy"? #31

Closed ghost closed 3 years ago

ghost commented 3 years ago

I tried set domain_rule.proxy ,but not works

{
    "domain_rules": {
        "proxy": [
            "**.*"
        ],
        "direct": [],
        "blocked": []
    }
}
imgk commented 3 years ago

What do you mean not working? Show me logs. If you want to use shadow as global proxy, modifying route table is a better way.

ghost commented 3 years ago

visit ipip.net,but ip not change.

CONFIG:

{
  "server": {
    "protocol": "trojan",
    "url": "trojan://123456@x.x.x.x:36022#x.x.x"
  },
  "name_server": "https://223.5.5.5:443/dns-query",
  "tun_name": "mytun",
  "tun_addr": [
    "192.168.0.11/24"
  ],
  "ip_cidr_rules": {
    "proxy": [
      "198.18.0.0/16",
      "8.8.8.8/32"
    ]
  },
  "domain_rules": {
    "proxy": [
      "**.*"
    ],
    "direct": [
    ],
    "blocked": [
    ]
  }
}

LOG:

D:\project\shadow> sudo .\shadow.exe -c .\v.json -v
2021/04/02 12:36:37 [Wintun] CreateAdapter: Creating adapter
2021/04/02 12:36:37 [Wintun] SelectDriver: Using existing driver 0.10
shadow - a transparent proxy for Windows, Linux and macOS
shadow is running...
Infor: 2021/04/02 12:36:37 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:37 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:37 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:37 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:37 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:38 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:38 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:38 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:38 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:39 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:40 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::1:3]:5355
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:41 ignore packets to [ff02::fb]:5353
Infor: 2021/04/02 12:36:42 ignore packets to [ff02::fb]:5353
imgk commented 3 years ago

Please check your DNS setting. And check your route table. No DNS query showed in the log. For more information, please refer https://github.com/imgk/shadow/issues/22.

ghost commented 3 years ago

I got it, case config changed....

https://github.com/imgk/shadow/commit/088455fca67103449374be3c0c2a6ece1f3579e0#diff-c2f1f64eeb5238c809d70b333d9987646e84982e0b133ffa4e0ca1ff86c78448