-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 on server side #704
Conversation
2 similar comments
Could you tell me under what circumstances this might be used? |
Some services like v2ray could serve as a unix socket, which is hiding the listening port on a censored system like AliCloud |
why not just listen on 127.0.0.1? |
besides, unix socket is faster than tcp socket. UNIX domain sockets know that they’re executing on the same system, so they can avoid some checks and operations (like routing); which makes them faster and lighter than IP sockets. So if you plan to communicate with processes on the same host, this is a better option than IP sockets. |
how about re-try scheme? like:
then we dont' have to specify |
any comment? |
I don't think that's a good idea. using try/catch as if/else is a bad practice. |
or, we can just try parse target to IP address and Port |
if you don't like the unix:// prefix, error checking is the only way to dial the right conn |
// check if target is unix domain socket
var isUnix bool
if _, _, err := net.SplitHostPort(config.Target); err != nil {
isUnix = true
} a simple check, though not strict |
Great |
No description provided.