关于 iOS 集成 tun2socks 的一些问题
本帖最后由 木然云 于 2024-9-25 15:23 编辑tun2socks config
[*] tunnel:
[*] mtu: 9000
[*] socks5:
[*] port: 7890
[*] address: ::1
[*] udp: 'udp'
[*] misc:
[*] task-stack-size: 20480
[*] connect-timeout: 5000
[*] read-write-timeout: 60000
[*] log-file: stderr
[*] log-level: error
[*] limit-nofile: 65535
[*]复制代码
PacketTunnelProvider
[*] let settings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "254.1.1.1")
[*] settings.mtu = 9000
[*] settings.ipv4Settings = {
[*] let settings = NEIPv4Settings(addresses: ["198.18.0.0"], subnetMasks: ["255.255.0.0"])
[*] settings.includedRoutes =
[*] return settings
[*] }()
[*] settings.ipv6Settings = {
[*]
[*] let settings = NEIPv6Settings(addresses: ["fd6e:a81b:704f:1211::1"], networkPrefixLengths: )
[*] settings.includedRoutes =
[*] return settings
[*] }()
[*] settings.dnsSettings = NEDNSSettings(servers: ["127.0.0.1"])
[*] try await self.setTunnelNetworkSettings(settings)复制代码
问题情况
当 socks5 地址为"监听本地起的 socks 服务时,就无法使用,所有的请求到达本地 socks 服务,都无法出去,形成了路由环路 请求超时
使用 *.*.*.* 远程 socks 服务一切正常
GPT 已经是问的想吐了,实在是没有任何的思路,includedRoutes excludedRoutes 都试过,别人的项目参考也看了,无法解决,请各位大佬指点下 跑通了应该还会面临内存问题
页:
[1]