OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / vendor / github.com / btcsuite / btcd / docs / configure_peer_server_listen_interfaces.md
1 btcd allows you to bind to specific interfaces which enables you to setup
2 configurations with varying levels of complexity.  The listen parameter can be
3 specified on the command line as shown below with the -- prefix or in the
4 configuration file without the -- prefix (as can all long command line options).
5 The configuration file takes one entry per line.
6
7 **NOTE:** The listen flag can be specified multiple times to listen on multiple
8 interfaces as a couple of the examples below illustrate.
9
10 Command Line Examples:
11
12 |Flags|Comment|
13 |----------|------------|
14 |--listen=|all interfaces on default port which is changed by `--testnet` and `--regtest` (**default**)|
15 |--listen=0.0.0.0|all IPv4 interfaces on default port which is changed by `--testnet` and `--regtest`|
16 |--listen=::|all IPv6 interfaces on default port which is changed by `--testnet` and `--regtest`|
17 |--listen=:8333|all interfaces on port 8333|
18 |--listen=0.0.0.0:8333|all IPv4 interfaces on port 8333|
19 |--listen=[::]:8333|all IPv6 interfaces on port 8333|
20 |--listen=127.0.0.1:8333|only IPv4 localhost on port 8333|
21 |--listen=[::1]:8333|only IPv6 localhost on port 8333|
22 |--listen=:8336|all interfaces on non-standard port 8336|
23 |--listen=0.0.0.0:8336|all IPv4 interfaces on non-standard port 8336|
24 |--listen=[::]:8336|all IPv6 interfaces on non-standard port 8336|
25 |--listen=127.0.0.1:8337 --listen=[::1]:8333|IPv4 localhost on port 8337 and IPv6 localhost on port 8333|
26 |--listen=:8333 --listen=:8337|all interfaces on ports 8333 and 8337|
27
28 The following config file would configure btcd to only listen on localhost for both IPv4 and IPv6:
29
30 ```text
31 [Application Options]
32
33 listen=127.0.0.1:8333
34 listen=[::1]:8333
35 ```