Skip to content

Commit f7868e6

Browse files
committed
refactor: reuse /udp port for /webrtc-direct
switches to version from libp2p/go-libp2p#2889
1 parent 0e0f585 commit f7868e6

5 files changed

Lines changed: 8 additions & 11 deletions

File tree

config/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ func addressesConfig() Addresses {
114114
"/ip6/::/tcp/4001",
115115
"/ip4/0.0.0.0/udp/4001/quic-v1",
116116
"/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
117-
"/ip4/0.0.0.0/udp/4002/webrtc-direct",
117+
"/ip4/0.0.0.0/udp/4001/webrtc-direct",
118118
"/ip6/::/udp/4001/quic-v1",
119119
"/ip6/::/udp/4001/quic-v1/webtransport",
120-
"/ip6/::/udp/4002/webrtc-direct",
120+
"/ip6/::/udp/4001/webrtc-direct",
121121
},
122122
Announce: []string{},
123123
AppendAnnounce: []string{},

docs/changelogs/v0.30.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#### WebRTC-Direct Transport enabled by default
2020

21-
Kubo now ships with `/udp/4002/webrtc-direct` listener enabled by default.
21+
Kubo now ships with `/udp/4001/webrtc-direct` listener enabled by default.
2222

2323
WebRTC Direct complements existing `/wss` (Secure WebSockets) and `/webtransport` transports. Unlike `/wss`, which requires a domain name and a CA-issued TLS certificate, WebRTC Direct works with IPs and can be enabled by default on all Kubo nodes.
2424

docs/config.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,13 +2257,10 @@ certificates. This can be useful for browser nodes that do not yet support
22572257
[WebTransport](https://blog.libp2p.io/2022-12-19-libp2p-webtransport/),
22582258
which is still relatively new and has [known issues](https://github.com/libp2p/js-libp2p/issues/2572).
22592259

2260-
Enabling this transport allows Kubo node to act on `/udp/4002/webrtc-direct`
2260+
Enabling this transport allows Kubo node to act on `/udp/4001/webrtc-direct`
22612261
listeners defined in `Addresses.Swarm`, `Addresses.Announce` or
22622262
`Addresses.AppendAnnounce`.
22632263

2264-
> [!IMPORTANT]
2265-
> At the moment, WebRTC Direct doesn't support listening on the same port as a QUIC or WebTransport listener, and Kubo uses 4002 for it.
2266-
22672264
> [!NOTE]
22682265
> WebRTC Direct is browser-to-node. It cannot be used to connect a browser
22692266
> node to a node that is behind a NAT or firewall.
@@ -2277,7 +2274,7 @@ Default: Enabled
22772274
Type: `flag`
22782275

22792276
Listen Addresses:
2280-
- `/ip4/0.0.0.0/udp/4002/webrtc-direct` (default)
2277+
- `/ip4/0.0.0.0/udp/4001/webrtc-direct` (default)
22812278
- `/ip6/::/udp/4001/webrtc-direct` (default)
22822279

22832280
### `Swarm.Transports.Security`

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require (
4848
github.com/jbenet/goprocess v0.1.4
4949
github.com/julienschmidt/httprouter v1.3.0
5050
github.com/libp2p/go-doh-resolver v0.4.0
51-
github.com/libp2p/go-libp2p v0.35.1-0.20240726083353-205f7be11544
51+
github.com/libp2p/go-libp2p v0.35.1-0.20240730155614-111d6df08497
5252
github.com/libp2p/go-libp2p-http v0.5.0
5353
github.com/libp2p/go-libp2p-kad-dht v0.25.2
5454
github.com/libp2p/go-libp2p-kbucket v0.6.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZ
508508
github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs=
509509
github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM=
510510
github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro=
511-
github.com/libp2p/go-libp2p v0.35.1-0.20240726083353-205f7be11544 h1:2ivyU6vXAsqOZ0+V54CibsXoxXJ43F8G4r+FfWEHx5Q=
512-
github.com/libp2p/go-libp2p v0.35.1-0.20240726083353-205f7be11544/go.mod h1:M/fCHPPkWjectocXCOUua4Z2lSr2cjQNByVVuxWPwXI=
511+
github.com/libp2p/go-libp2p v0.35.1-0.20240730155614-111d6df08497 h1:to+AtiMFh2NatsQrX3LeuzRT/yl4/qkAh9n+CLQxhlE=
512+
github.com/libp2p/go-libp2p v0.35.1-0.20240730155614-111d6df08497/go.mod h1:M/fCHPPkWjectocXCOUua4Z2lSr2cjQNByVVuxWPwXI=
513513
github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94=
514514
github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8=
515515
github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g=

0 commit comments

Comments
 (0)