JuliaWeb/HTTP.jl

Support for domain sockets

Geschlossen

#607 geöffnet am 27.10.2020

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Julia (182 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (679 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 2T 5h) (40 gemergte PRs in 30 T)

Beschreibung

I was trying to communicate with a local domain socket that accepts HTTP, which I'm currently doing like so:

docker = connect("/var/run/docker.sock")
write(docker, """
    GET /info HTTP/1.1
    Host: localhost
    Accept: application/json


    """)
@show read(docker, String)
close(docker)

That doesn't really work with HTTP.jl right now, the connection layer doesn't support these sockets, and there isn't a way to separate the path to the socket from the path to request. One interesting approach by https://github.com/msabramo/requests-unixsocket is using the following URI format: http+unix://%2Fvar%2Frun%2Fdocker.sock/info.

Contributor Guide