vapor-community / sockets

🔌 Non-blocking TCP socket layer, with event-driven server and client.
MIT License
575 stars 54 forks source link

Support UNIX socket #146

Closed valeriomazzeo closed 2 years ago

valeriomazzeo commented 7 years ago

This would eventually allow a Client to be initialised with a UNIX socket to perform the curl equivalent:

$ curl --unix-socket /var/run/docker.sock -H "Content-Type: application/json" \
  -d '{"Image": "alpine", "Cmd": ["echo", "hello world"]}' \
  -X POST http:/v1.24/containers/create
{"Id":"1c6594faf5","Warnings":null}

$ curl --unix-socket /var/run/docker.sock -X POST http:/v1.24/containers/1c6594faf5/start

$ curl --unix-socket /var/run/docker.sock -X POST http:/v1.24/containers/1c6594faf5/wait
{"StatusCode":0}

$ curl --unix-socket /var/run/docker.sock "http:/v1.24/containers/1c6594faf5/logs?stdout=1"
hello world

From the Vapor slack help channel:

Joannis commented 7 years ago

I'm completely behind this one. I'll add it to Vapor 3 for sure. I doubt this'll make it for Vapor 2 with Vapor 3 being in development.