You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the websocket transport relies on the DNS transport, it's affected by the same issue as its dependency (#2064) and fails to work on Android. For DNS, the issue can be mitigated by providing custom libp2p_dns::ResolverConfig and libp2p_dns::ResolverOpts instead of trying to read the system configuration, but this is not currently possible for websockets, since the websocket builder (for tokio) creates a DNS transport instance internally and doesn't allow any customization:
SwarmBuilder::with_websocket successfully configures the websocket transport on Android.
Actual behavior
SwarmBuilder::with_websocket returns an error due to an internal DNS issue where /etc/resolv.conf can't be found.
Relevant log output
No response
Possible Solution
I'm not very familiar with the library’s internals, but the most straightforward solution appears to be to allow custom configuration for the internal DNS transport so the builder doesn’t attempt to read the system config. This could be achieved by introducing a libp2p_websocket::Config structure, similar to those used by other transports (e.g., TCP), with optional DNS configuration for creating the DNS transport instance. However, the DNS configuration should probably be only included when applicable, such as when using the tokio runtime, to avoid cluttering the interface.
Version
0.54.1
Would you like to work on fixing this bug ?
Maybe
The text was updated successfully, but these errors were encountered:
Thank you for the report. A workaround would probably be to use Swarm::new and supply a transport that way with your option. Long term, we should probably pass a configuration option from the builder or maybe just use TokioDnsConfig::custom by default.
Summary
Since the websocket transport relies on the DNS transport, it's affected by the same issue as its dependency (#2064) and fails to work on Android. For DNS, the issue can be mitigated by providing custom
libp2p_dns::ResolverConfig
andlibp2p_dns::ResolverOpts
instead of trying to read the system configuration, but this is not currently possible for websockets, since the websocket builder (fortokio
) creates a DNS transport instance internally and doesn't allow any customization:rust-libp2p/libp2p/src/builder/phase/websocket.rs
Lines 126 to 135 in 4192fc3
Expected behavior
SwarmBuilder::with_websocket
successfully configures the websocket transport on Android.Actual behavior
SwarmBuilder::with_websocket
returns an error due to an internal DNS issue where/etc/resolv.conf
can't be found.Relevant log output
No response
Possible Solution
I'm not very familiar with the library’s internals, but the most straightforward solution appears to be to allow custom configuration for the internal DNS transport so the builder doesn’t attempt to read the system config. This could be achieved by introducing a
libp2p_websocket::Config
structure, similar to those used by other transports (e.g., TCP), with optional DNS configuration for creating the DNS transport instance. However, the DNS configuration should probably be only included when applicable, such as when using the tokio runtime, to avoid cluttering the interface.Version
0.54.1
Would you like to work on fixing this bug ?
Maybe
The text was updated successfully, but these errors were encountered: