Skip to content

Commit 7861c11

Browse files
committed
fix: set only /tls/ws address to avoid user having to configure extra port
1 parent 2283d8c commit 7861c11

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

docs/networking.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ Example for a node with public IP `1.2.3.4`, using ports 9000 (TCP) and 9001 (We
1212
P2P_ANNOUNCE_ADDRESSES='[
1313
"/ip4/1.2.3.4/tcp/9000",
1414
"/ip4/1.2.3.4/tcp/9001/ws",
15-
"/ip4/1.2.3.4/tcp/9001/tls/ws",
16-
"/ip4/1.2.3.4/tcp/9001/tls/wss"
15+
"/ip4/1.2.3.4/tcp/9001/tls/ws"
1716
]'
1817
```
1918

20-
The `/tls/ws` and `/tls/wss` entries enable [AutoTLS](#tls-and-sni-server-name-indication) for node-to-browser communication. AutoTLS handles certificate provisioning automatically — no DNS setup required on your part.
19+
The `/tls/ws` entry enables [AutoTLS](#tls-and-sni-server-name-indication) for node-to-browser communication. AutoTLS provisions a certificate and serves TLS at the transport layer on the WebSocket port, making it browser-compatible — no DNS setup required on your part.
2120

2221
## Option 2: Dynamic DNS (no static IP)
2322

@@ -31,8 +30,7 @@ Once you have a hostname (e.g. `mynode.duckdns.org`), set up the DDNS client on
3130
P2P_ANNOUNCE_ADDRESSES='[
3231
"/dns4/mynode.duckdns.org/tcp/9000",
3332
"/dns4/mynode.duckdns.org/tcp/9001/ws",
34-
"/dns4/mynode.duckdns.org/tcp/9001/tls/ws",
35-
"/dns4/mynode.duckdns.org/tcp/9001/tls/wss"
33+
"/dns4/mynode.duckdns.org/tcp/9001/tls/ws"
3634
]'
3735
```
3836

@@ -74,16 +72,17 @@ Do not enable `P2P_ENABLE_CIRCUIT_RELAY_SERVER` on edge nodes; that setting is f
7472

7573
## TLS and SNI (Server Name Indication)
7674

77-
AutoTLS provisions TLS certificates for your node automatically, enabling P2P node-to-browser communication. It is always active internally — no DNS or certificate setup required on your part. For it to work, you must include `/tls/ws` or `/tls/wss` entries in `P2P_ANNOUNCE_ADDRESSES`, which the quickstart script does automatically.
75+
AutoTLS provisions TLS certificates for your node automatically, enabling P2P node-to-browser communication. It is always active internally — no DNS or certificate setup required on your part. For it to work, you must include a `/tls/ws` entry in `P2P_ANNOUNCE_ADDRESSES`, which the quickstart script does automatically.
76+
77+
AutoTLS serves TLS at the transport layer on the WebSocket port, making it standard browser-compatible WSS — no separate port is needed.
7878

7979
Example `.env` / docker-compose entry:
8080

8181
```bash
8282
P2P_ANNOUNCE_ADDRESSES='[
8383
"/ip4/<your-ip>/tcp/9000",
8484
"/ip4/<your-ip>/tcp/9001/ws",
85-
"/ip4/<your-ip>/tcp/9001/tls/ws",
86-
"/ip4/<your-ip>/tcp/9001/tls/wss"
85+
"/ip4/<your-ip>/tcp/9001/tls/ws"
8786
]'
8887
```
8988

@@ -95,8 +94,7 @@ Or in `config.json`:
9594
"announceAddresses": [
9695
"/ip4/<your-ip>/tcp/9000",
9796
"/ip4/<your-ip>/tcp/9001/ws",
98-
"/ip4/<your-ip>/tcp/9001/tls/ws",
99-
"/ip4/<your-ip>/tcp/9001/tls/wss"
97+
"/ip4/<your-ip>/tcp/9001/tls/ws"
10098
]
10199
}
102100
}

scripts/ocean-node-quickstart.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ if [ -n "$P2P_ANNOUNCE_ADDRESS" ]; then
182182

183183
if [[ "$P2P_ANNOUNCE_ADDRESS" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
184184
# IPv4
185-
P2P_ANNOUNCE_ADDRESSES='["/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindTcpPort'", "/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/ws", "/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/ws", "/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/wss"]'
185+
P2P_ANNOUNCE_ADDRESSES='["/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindTcpPort'", "/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/ws", "/ip4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/ws"]'
186186
elif [[ "$P2P_ANNOUNCE_ADDRESS" =~ ^[a-zA-Z0-9.-]+$ ]]; then
187187
# FQDN
188-
P2P_ANNOUNCE_ADDRESSES='["/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindTcpPort'", "/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/ws", "/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/ws", "/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/wss"]'
188+
P2P_ANNOUNCE_ADDRESSES='["/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindTcpPort'", "/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/ws", "/dns4/'$P2P_ANNOUNCE_ADDRESS'/tcp/'$P2P_ipV4BindWsPort'/tls/ws"]'
189189
fi
190190
else
191191
P2P_ANNOUNCE_ADDRESSES=''

0 commit comments

Comments
 (0)