Optimize ip detection
Support android vpn ipv6 inbound switch Support log export Optimize more details
This commit is contained in:
@@ -18,6 +18,7 @@ type AndroidProps struct {
|
||||
AccessControl *AccessControl `json:"accessControl"`
|
||||
AllowBypass bool `json:"allowBypass"`
|
||||
SystemProxy bool `json:"systemProxy"`
|
||||
Ipv6 bool `json:"ipv6"`
|
||||
}
|
||||
|
||||
type State struct {
|
||||
|
||||
@@ -31,18 +31,21 @@ func Start(tunProps Props) (*sing_tun.Listener, error) {
|
||||
return nil, err
|
||||
}
|
||||
prefix4 = append(prefix4, tempPrefix4)
|
||||
|
||||
var prefix6 []netip.Prefix
|
||||
tempPrefix6, err := netip.ParsePrefix(tunProps.Gateway6)
|
||||
if err != nil {
|
||||
log.Errorln("startTUN error:", err)
|
||||
return nil, err
|
||||
if tunProps.Gateway6 != "" {
|
||||
tempPrefix6, err := netip.ParsePrefix(tunProps.Gateway6)
|
||||
if err != nil {
|
||||
log.Errorln("startTUN error:", err)
|
||||
return nil, err
|
||||
}
|
||||
prefix6 = append(prefix6, tempPrefix6)
|
||||
}
|
||||
prefix6 = append(prefix6, tempPrefix6)
|
||||
|
||||
var dnsHijack []string
|
||||
dnsHijack = append(dnsHijack, net.JoinHostPort(tunProps.Dns, "53"))
|
||||
dnsHijack = append(dnsHijack, net.JoinHostPort(tunProps.Dns6, "53"))
|
||||
if tunProps.Dns6 != "" {
|
||||
dnsHijack = append(dnsHijack, net.JoinHostPort(tunProps.Dns6, "53"))
|
||||
}
|
||||
|
||||
options := LC.Tun{
|
||||
Enable: true,
|
||||
|
||||
Reference in New Issue
Block a user