Closed lflish closed 8 months ago
Hi! Thanks for your PR.
Unix socket can be a great source input for tun2socks project. Can we implement it in the core/device
pkg directly?
你好
新改的代码放到了core/device目录了,但是对设备解析的函数parseDevice
中, url.Parse(s)函数对unix:///tmp/unix.sock
这种格式解析有问题,所以把这里也重新写了下。
devInfo := strings.Split(s, "://")
if len(devInfo) < 2 {
return nil, fmt.Errorf("unsupported device: %s", s)
}
driver, name := devInfo[0], devInfo[1]
There is actually no issue with this parsing process, you don’t need u.Host
, just use u.Path
directly.
多谢指点,这块代码回滚重新提交了
This is a great project. For ease of use, I gave it a little detail. Using FD is compatible with all Linux communication, and I optimized it to use Unix sockets directly,It has no effect on the original method
device: unix:///tmp/unix_socket