JuliaWeb/HTTP.jl

Support for domain sockets

クローズ

#607 opened on 2020/10/27

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Julia (182 件のフォーク)batch import
enhancementhelp wanted

Repository metrics

Stars
 (679 個のスター)
PR merge metrics
 (平均マージ 2d 5h) (30d で 40 merged PRs)

説明

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.

コントリビューターガイド