<p>The RPC interface is not exposed over Tor. The only thing that goes over Tor is the P2P connection. To access the RPC server, you need to connect directly to the node's IP address, not connect to it over Tor. Note that the RPC interface and the P2P interface are two different things; the RPC interface is private facing while the P2P interface is public facing.</p>

CC BY-SA 3.0
2017-09-01T19:23:18.363Z
Thanks for your reply! I was really stuck and I didn't know that the RPC can't be exposed over TOR!
John Graham
CC BY-SA 3.0
2017-09-01T03:35:53.577Z
2017-09-01T03:35:53.577Z
Ava Chow
<p>I configured my full bitcoin node behind tor (nowadays there aren't much bitcoin nodes behind tor network, this website: <a href="https://bitnodes.21.co/nodes/?q=Tor%20network" rel="nofollow noreferrer">https://bitnodes.21.co/nodes/?q=Tor%20network</a> tell us that there are just 323 nodes), for the moment I hadn't any problem configuring it behind tor. But the problem comes when I want to connect through a rpc client to my bitcoin node. I am using this project as code base: <a href="https://github.com/aceat64/EasyBitcoin-PHP" rel="nofollow noreferrer">https://github.com/aceat64/EasyBitcoin-PHP</a> and I modify the <code>function __call</code> in the following way:</p>

<pre><code>$options = array(
            CURLOPT_HTTPAUTH       =&gt; CURLAUTH_BASIC,
            CURLOPT_USERPWD        =&gt; $this-&gt;username . ':' . $this-&gt;password,
            CURLOPT_PROXY          =&gt; '127.0.0.1:9050',
            CURLOPT_PROXYTYPE      =&gt; 7,
            CURLOPT_RETURNTRANSFER =&gt; TRUE,
            CURLOPT_FOLLOWLOCATION =&gt; TRUE,
            CURLOPT_MAXREDIRS      =&gt; 10,
            CURLOPT_HTTPHEADER     =&gt; array('Content-type: application/json'),
            CURLOPT_POST           =&gt; TRUE,
            CURLOPT_POSTFIELDS     =&gt; $request
        );
</code></pre>

<p>I am very stuck with this issue, due to that I am getting all time <code>Can't complete SOCKS5 connection to 0.0.0.0:0.</code>, I have the tor service running and I didn't find any tutorial about how to connect and authenticate to a bitcoin node using php and curl.</p>

<p>Best regards and thanks in advance</p>

<bitcoin-core><bitcoind><json-rpc><php><tor>
Connect to Bitcoin Node behind tor network
John Graham
# Connect to Bitcoin Node behind tor network

(Asked by: username_0 on 2017-08-31)

I configured my full bitcoin node behind tor (nowadays there aren't much bitcoin nodes behind tor network, this website: <https://bitnodes.21.co/nodes/?q=Tor%20network> tell us that there are just 323 nodes), for the moment I hadn't any problem configuring it behind tor. But the problem comes when I want to connect through a rpc client to my bitcoin node. I am using this project as code base: <https://github.com/aceat64/EasyBitcoin-PHP> and I modify the `function __call` in the following way:

```
$options = array(
            CURLOPT_HTTPAUTH       => CURLAUTH_BASIC,
            CURLOPT_USERPWD        => $this->username . ':' . $this->password,
            CURLOPT_PROXY          => '127.0.0.1:9050',
            CURLOPT_PROXYTYPE      => 7,
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_FOLLOWLOCATION => TRUE,
            CURLOPT_MAXREDIRS      => 10,
            CURLOPT_HTTPHEADER     => array('Content-type: application/json'),
            CURLOPT_POST           => TRUE,
            CURLOPT_POSTFIELDS     => $request
        );

```

I am very stuck with this issue, due to that I am getting all time `Can't complete SOCKS5 connection to 0.0.0.0:0.`, I have the tor service running and I didn't find any tutorial about how to connect and authenticate to a bitcoin node using php and curl.

Best regards and thanks in advance

**Tags:** bitcoin-core, bitcoind, json-rpc, php, tor


---

## 1 answers

### Answer by username_1 on 2017-09-01. Score: 2 | Accepted answer

The RPC interface is not exposed over Tor. The only thing that goes over Tor is the P2P connection. To access the RPC server, you need to connect directly to the node's IP address, not connect to it over Tor. Note that the RPC interface and the P2P interface are two different things; the RPC interface is private facing while the P2P interface is public facing.

> **Comments:**
> **username_0**: Thanks for your reply! I was really stuck and I didn't know that the RPC can't be exposed over TOR!  

---

