Skip to content

Proposal - TFPCustomHTTPClient support of HTTP over unix domain socket

Summary

Allow HTTP client the possibility to connect using unix domain socket, due to security concerns, http clients are not always expected to connect only using tcp based http servers.

Example

https://docs.podman.io/en/latest/_static/api.html

curl --unix-socket /run/podman/podman.sock http://d/v3.0.0/libpod/info

What is the current bug behavior?

New feature, not bug

What is the behavior after applying this patch?

The users will be able to use it in a very simple way, just as expected HTTP client

Var
  S : String;
begin
  With TFPCustomHTTPClient.Create(nil) do
    try
      UnixSocketPath := '/tmp/podman.sock';
      S := Get('http://d/v3.0.0/libpod/info');
      Results.Append(S);
      WriteLn(S);
    finally
      Free;
    end;
end;

See discussion - https://forum.lazarus.freepascal.org/index.php/topic,39141.0.html

Merge request reports