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 Request] Add Unix Domain Socket support #252

Closed
gubiao opened this issue Jul 20, 2021 · 1 comment
Closed

[Feature Request] Add Unix Domain Socket support #252

gubiao opened this issue Jul 20, 2021 · 1 comment

Comments

@gubiao
Copy link

gubiao commented Jul 20, 2021

Is it possible to add Unix Domain Socket support?
I use Cloudflare CDN + Nginx(TLS) + Shadowsocks-rust + v2ray-plugin (websocket).
Nginx proxy my website and ss+v2ray-plugin at the same time.
It would be great if v2ray-plugin could add UDS support.
Many people told me that UDS is faster than a local loopback connection. I also found this:
https://stackoverflow.com/questions/14973942/tcp-loopback-connection-vs-unix-domain-socket-performance

My current Nginx configuration:
...
upstream myssserver {
server 127.0.0.1:8000;
keepalive 32;
keepalive_requests 2000;
keepalive_time 7d;
keepalive_timeout 7d;
}
...
location /haha {
proxy_pass http://myssserver;
proxy_socket_keepalive on;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_next_upstream off;
proxy_redirect off;
proxy_connect_timeout 5s;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
proxy_buffering off;
proxy_request_buffering off;
keepalive_requests 2000;
keepalive_time 7d;
keepalive_timeout 7d;
}
...

If v2ray-plugin can provide UDS support, then Nginx can communicate with v2ray-plugin through UDS:
upstream myssserver {
server unix:/myssserver.socks;
....
}

Communicating through the TCP connection of the network loopback address will result in a large number of 127.0.0.1->127.0.0.1 TCP connections.

@gubiao
Copy link
Author

gubiao commented Jul 21, 2021

@gubiao gubiao closed this as completed Jul 21, 2021
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

No branches or pull requests

1 participant