mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
整理代码
This commit is contained in:
@@ -6,7 +6,14 @@ tun 工作在第三层 IP层上。
|
||||
|
||||
我们使用 github.com/eycorsican/go-tun2socks 包
|
||||
|
||||
# Problem 问题
|
||||
|
||||
这个包在windows上会使用tap。
|
||||
|
||||
目前测试在windows上效果非常不好,响应很慢,似乎和udp或者dns有一定关联.
|
||||
它总在访问组播地址 239.255.255.250
|
||||
|
||||
eycorsican/go-tun2socks 包问题不小,不仅有平台间不一致的问题,而且tun关闭后无法再重新开启
|
||||
*/
|
||||
package tun
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ func (s *Server) Stop() {
|
||||
}
|
||||
|
||||
func (s *Server) StartListen(tcpRequestChan chan<- netLayer.TCPRequestInfo, udpRequestChan chan<- netLayer.UDPRequestInfo) io.Closer {
|
||||
s.stopped = false
|
||||
//log.Println(s.devName, s.selfip, s.realIP, s.mask)
|
||||
realname, tunDev, err := tun.CreateTun(s.devName, s.selfip, s.realIP, s.mask, s.tun_dnsList)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user