Initial commit

This commit is contained in:
chen08209
2024-04-30 23:38:49 +08:00
commit df4d38012b
295 changed files with 33443 additions and 0 deletions

20
core/tun/tcp.go Normal file
View File

@@ -0,0 +1,20 @@
//go:build android
package tun
import (
"github.com/metacubex/mihomo/constant"
"net"
)
func createMetadata(lAddr, rAddr *net.TCPAddr) *constant.Metadata {
return &constant.Metadata{
NetWork: constant.TCP,
Type: constant.SOCKS5,
SrcIP: lAddr.AddrPort().Addr(),
DstIP: rAddr.AddrPort().Addr(),
SrcPort: uint16(lAddr.Port),
DstPort: uint16(rAddr.Port),
Host: "",
}
}