Skip to content

Commit

Permalink
fix: ethernet icon instead of Wi-Fi icon on Windows task bar
Browse files Browse the repository at this point in the history
  • Loading branch information
igoogolx committed Jun 10, 2024
1 parent 2c75276 commit 6052a90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/cfg/tun/tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func New() (*Config, error) {
if err != nil {
return nil, err
}
tunInterfaceName := sTun.CalculateInterfaceName(constants.TunName)
tunInterfaceName := sTun.CalculateInterfaceName(constants.TunName())
return &Config{
Name: tunInterfaceName,
Mtu: constants.TunMtu,
Expand Down
11 changes: 10 additions & 1 deletion internal/constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package constants

import "runtime"

type Policy string

const (
Expand Down Expand Up @@ -28,8 +30,15 @@ const (

const DnsPort = "53"

func TunName() string {
if runtime.GOOS == "windows" {
//It is tricky. Utun is "bigger" than Wi-Fi so that ethernet icon is displayed on the task bar.
return "ztun"
}
return "utun"
}

const (
TunName = "utun"
TunGateway = "10.255.0.1/30"
TunMtu = 1500
)
Expand Down

0 comments on commit 6052a90

Please sign in to comment.