mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
feat: enable hole-punching by default
This commit is contained in:
parent
be1acfa1c5
commit
7ad6447453
@ -245,7 +245,7 @@ jobs:
|
||||
command: |
|
||||
npm init -y
|
||||
npm install ipfs@^0.61.0
|
||||
npm install ipfs-interop@^8.0.0
|
||||
npm install ipfs-interop@^8.0.10
|
||||
npm install mocha-circleci-reporter@0.0.3
|
||||
working_directory: ~/ipfs/go-ipfs/interop
|
||||
- run:
|
||||
|
||||
@ -69,9 +69,10 @@ func AutoRelay(staticRelays []string, peerChan <-chan peer.AddrInfo) func() (opt
|
||||
|
||||
func HolePunching(flag config.Flag, hasRelayClient bool) func() (opts Libp2pOpts, err error) {
|
||||
return func() (opts Libp2pOpts, err error) {
|
||||
if flag.WithDefault(false) {
|
||||
if flag.WithDefault(true) {
|
||||
if !hasRelayClient {
|
||||
log.Fatal("To enable `Swarm.EnableHolePunching` requires `Swarm.RelayClient.Enabled` to be enabled.")
|
||||
log.Fatal("Failed to enable `Swarm.EnableHolePunching`, it requires `Swarm.RelayClient.Enabled` to be true.")
|
||||
return
|
||||
}
|
||||
opts.Opts = append(opts.Opts, libp2p.EnableHolePunching())
|
||||
}
|
||||
|
||||
@ -1383,7 +1383,7 @@ to [upgrade to a direct connection](https://github.com/libp2p/specs/blob/master/
|
||||
through a NAT/firewall whenever possible.
|
||||
This feature requires `Swarm.RelayClient.Enabled` to be set to `true`.
|
||||
|
||||
Default: `false`
|
||||
Default: `true`
|
||||
|
||||
Type: `flag`
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user