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

Add unix socket support #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add unix socket support #67

wants to merge 2 commits into from

Conversation

immibis
Copy link

@immibis immibis commented Sep 23, 2023

This patch allows microsocks to listen on a UNIX domain socket (AF_UNIX).

Unix client addresses will be truncated in client->addr, but we don't care because -1 is not supported in this mode.

Disappointingly there's nothing you can pass to getaddrinfo to make it return a UNIX socket address, so a whole new function is needed.

@immibis
Copy link
Author

immibis commented Sep 23, 2023

actually there is a bug here - when a client connects its address is printed from uninitialized memory

@immibis
Copy link
Author

immibis commented Sep 23, 2023

Addresses not known by inet_ntop will be logged as blank. In the case of UNIX sockets, the client address is almost certain to be a randomly generated byte string so there isn't much the user can do with it.

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.

1 participant