-
-
Notifications
You must be signed in to change notification settings - Fork 82
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 to http.request #99
Comments
This isn't supported at the moment because I couldn't figure out how it would work. If you have a usecase could you tell me:
|
For now, I'm using it in development only, so I haven't considered TLS behavior. Maybe the |
I'm writing a higher level module that wraps |
Added help-wanted label, as answers to the above questions need to be determined before solving this request. |
While this is an ancient report, I'd like to share some information for my use case for wanting unix socket support in The major reason for it is that I'd like to talk to the Docker API via a unix socket. The API is HTTP over a unix socket, no TLS, the host header is ignored, by the looks of it. As an experiment, I used socat to proxy between the docker socket and TCP:
To this, the docker API just responds with an ordinary HTTP response with a JSON payload. When connecting via the socket itself, the docker client sets So pretty much all I want from Now, why do I want to connect to the Docker API via a unix socket, rather than telling my docker daemon to listen on tcp too? Because by default, tcp is unencrypted, so any local user would be able to talk to my docker, while the unix socket has permissions. I could, of course, ask Docker to only allow clients that present a TLS cert signed by a trusted CA, but that's a whole lot of work when the client is on the same host anyway. Thus, talking to Docker from Lua is easiest if I can do it over a unix socket. |
@algernon note that you can use Perhaps some of the logic in |
There's some interesting discussion over at whatwg/url#577 about how to indicate a unix socket should be used with a URL |
Or provide an example of using
http.client
to communicate with a Unix socket.The text was updated successfully, but these errors were encountered: