btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.2k stars 2.36k forks source link

Support Sending RPC Requests to Bitcoin Core Over Unix Socket #2149

Closed robertmin1 closed 3 months ago

robertmin1 commented 6 months ago

It would be great to support sending RPC requests to Bitcoin Core over a Unix socket. Bitcoin Core only supports RPC over HTTP. To work around this limitation, we can send HTTP requests over a Unix socket and then redirect them to the Bitcoin Core server using a program such as socat. This approach has been tested and works without any issues.

I wanted to get your input before working on a PR. This will only involve adding a config field for the socket path and adding a Dial Context to the HTTP client + Explanation on how to use it

Here is an example of http over unix socket: https://gist.github.com/teknoraver/5ffacb8757330715bcbcc90e6d46ac74#file-unixhttpc-go-L27-L31 Benefits: Security

robertmin1 commented 3 months ago

Closed by #2168