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(socks5): support abstract namespace unix sock #436

Merged

Conversation

SuzukiHonoka
Copy link
Contributor

On Linux, if the name starts with an at symbol (‘@') it is read as an abstract namespace socket: the leading ‘@' is replaced with a NUL byte before binding or connecting. For details, see unix(7)

In golang, we can add @ or use 0x0 as prefix to the unix addr for using Linux abstract namespace.
But the current unix processing logic can't not parse it, it only supports the filesystem socket type.
This PR should fix this.

@xjasonlyu xjasonlyu self-requested a review December 20, 2024 17:21
@xjasonlyu xjasonlyu added the enhancement New feature or request label Dec 20, 2024
@xjasonlyu xjasonlyu changed the title feat: support Linux abstract namespace Feature(socks5): support abstract namespace unix sock Dec 20, 2024
Copy link
Owner

@xjasonlyu xjasonlyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing the abstract namespace unix sock feature to the socks5 module!

It overall looks good to me. Just a small question.

proxy/socks5.go Show resolved Hide resolved
Copy link
Owner

@xjasonlyu xjasonlyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR can be merged first.

The abstract feature should work fine in the current implementation, and another PR can be opened later to refactor it as we discussed if needed.

@xjasonlyu xjasonlyu merged commit 302622f into xjasonlyu:main Jan 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants