Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: device add support unixsocket use fd #286

Closed
wants to merge 0 commits into from

Conversation

lflish
Copy link

@lflish lflish commented Aug 18, 2023

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

@xjasonlyu xjasonlyu self-requested a review August 23, 2023 18:37
@xjasonlyu
Copy link
Owner

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?

@lflish
Copy link
Author

lflish commented Aug 28, 2023

你好
新改的代码放到了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]

@xjasonlyu
Copy link
Owner

xjasonlyu commented Aug 29, 2023

There is actually no issue with this parsing process, you don’t need u.Host, just use u.Path directly.

@lflish
Copy link
Author

lflish commented Aug 31, 2023

多谢指点,这块代码回滚重新提交了

@lflish lflish changed the title featuer: device add support unixsocket use fd feature: device add support unixsocket use fd Sep 11, 2023
@lflish lflish closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants