bitpay/bitcore — pull request #210 by gordonwritescode (2014-04-04 16:01:41+00:00)
Title: add support for connecting over tor

adds an additional `options` argument to the `Connection` constructor, where you may specify:

```
{
proxy: { host: '127.0.0.1', port: 9050 }
}
```

Specifying this will let you pass `null` as the `socket` argument and the `Connection` constructor will create a socket for you that is bound to the specified SOCKS5 proxy.

also adds a new method to `Connection` called `open()`, which is just sugar for `connection.socket.connect(connection.peer.port, connection.peer.host)`. you can pass an optional callback, that will be set as a one-time event listener for `connect`.

example usage has been added to the examples as *ConnectionTor.js*.

**this should not break any existing functionality**