JuliaWeb/HTTP.jl

Support for domain sockets

已關閉

#607 建立於 2020年10月27日

 (2 則留言) (0 個反應) (0 位負責人)Julia (182 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (679 顆星)
PR 合併指標
 (平均合併 2天 5小時) (30 天內合併 40 個 PR)

描述

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.

貢獻者指南