SadeghHayeri / GreenTunnel

GreenTunnel is an anti-censorship utility designed to bypass the DPI system that is put in place by various ISPs to block access to certain websites.
MIT License
4.24k stars 273 forks source link

SetProxy error when darwin device connected at VPN #112

Open Hoto-Cocoa opened 3 years ago

Hoto-Cocoa commented 3 years ago

Describe the bug At this time, GreenTunnel tries get device name that handle routing to 0.0.0.0, and get Network services name by device name.

However, darwin doesn't fill device name to VPN Network service when running listnetworkserviceorder.

Example result here:

~ % networksetup -listnetworkserviceorder
An asterisk (*) denotes that a network service is disabled.
(1) USB 10/100/1000 LAN
(Hardware Port: USB 10/100/1000 LAN, Device: en7)

(2) Wi-Fi
(Hardware Port: Wi-Fi, Device: en0)

(3) Bluetooth PAN
(Hardware Port: Bluetooth PAN, Device: en6)

(4) Thunderbolt Bridge
(Hardware Port: Thunderbolt Bridge, Device: bridge0)

(5) (VPN Name)
(Hardware Port: L2TP, Device: ) # <- empty

So sh -c "networksetup -listnetworkserviceorder (...) cut -d ' ' -f2" command returns empty string, then GreenTunnel execute networksetup -setwebproxy '' 127.0.0.1 8000. This returns error with ** Error: The parameters were not valid. message.

To Reproduce Steps to reproduce the behavior:

  1. Setup VPN on darwin device. (In my case, L2TP/IPsec used)
  2. Start green-tunnel with --system-proxy option.

Expected behavior System proxy points GreenTunnel automatically.

Screenshots image

Desktop (please complete the following information):