{"record":{"id":"48667e655f18c3b5","repo":"ipfs/kubo","slug":"webrtc-direct-transport-does-not-support-private-n","errorCode":null,"errorMessage":"WebRTC Direct transport does not support private networks, please disable Swarm.Transports.Network.WebRTCDirect","messagePattern":"WebRTC Direct transport does not support private networks, please disable Swarm\\.Transports\\.Network\\.WebRTCDirect","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/node/libp2p/transport.go","lineNumber":72,"sourceCode":"\t\t\t\treturn opts, fmt.Errorf(\n\t\t\t\t\t\"QUIC transport does not support private networks, please disable Swarm.Transports.Network.QUIC\",\n\t\t\t\t)\n\t\t\t}\n\t\t\topts.Opts = append(opts.Opts, libp2p.Transport(quic.NewTransport))\n\t\t}\n\n\t\tif tptConfig.Network.WebTransport.WithDefault(!privateNetworkEnabled) {\n\t\t\tif privateNetworkEnabled {\n\t\t\t\treturn opts, fmt.Errorf(\n\t\t\t\t\t\"WebTransport transport does not support private networks, please disable Swarm.Transports.Network.WebTransport\",\n\t\t\t\t)\n\t\t\t}\n\t\t\topts.Opts = append(opts.Opts, libp2p.Transport(webtransport.New))\n\t\t}\n\n\t\tif tptConfig.Network.WebRTCDirect.WithDefault(!privateNetworkEnabled) {\n\t\t\tif privateNetworkEnabled {\n\t\t\t\treturn opts, fmt.Errorf(\n\t\t\t\t\t\"WebRTC Direct transport does not support private networks, please disable Swarm.Transports.Network.WebRTCDirect\",\n\t\t\t\t)\n\t\t\t}\n\t\t\topts.Opts = append(opts.Opts, libp2p.Transport(webrtc.New))\n\t\t}\n\n\t\treturn opts, nil\n\t}\n}\n\nfunc BandwidthCounter() (opts Libp2pOpts, reporter *metrics.BandwidthCounter) {\n\treporter = metrics.NewBandwidthCounter()\n\topts.Opts = append(opts.Opts, libp2p.BandwidthReporter(reporter))\n\treturn opts, reporter\n}\n","sourceCodeStart":54,"sourceCodeEnd":88,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/node/libp2p/transport.go#L54-L88","documentation":"WebRTC Direct is another QUIC-based transport and cannot run inside a libp2p private network. Kubo validates the transport configuration at startup and fails fast when WebRTCDirect is enabled together with a private network, since go-libp2p does not support that combination.","triggerScenarios":"Daemon startup with Swarm.Transports.Network.WebRTCDirect explicitly enabled (true) while a private network (pnet swarm key) is active; the default would disable it in that case, so only an explicit enable triggers the error.","commonSituations":"Private swarm operators enabling every transport in config to maximize connectivity without realizing QUIC-family transports exclude private networks.","solutions":["Disable it: `ipfs config --json Swarm.Transports.Network.WebRTCDirect false`","Disable the other QUIC-family transports too (QUIC, WebTransport) to clear errors 592/593","Keep TCP enabled as the transport for the private swarm","Restart the daemon"],"exampleFix":"// before\nipfs config --json Swarm.Transports.Network.WebRTCDirect true\n\n// after (private network)\nipfs config --json Swarm.Transports.Network.WebRTCDirect false","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := node.Start(ctx); err != nil {\n    if strings.Contains(err.Error(), \"WebRTC Direct transport does not support private networks\") {\n        return fmt.Errorf(\"private network active: set Swarm.Transports.Network.WebRTCDirect=false: %w\", err)\n    }\n    return err\n}","preventionTips":[],"tags":["libp2p","webrtc","private-network","transport"],"backgroundTag":"transport-incompatible-with-private-network","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}