libp2p / libp2p/rust-libp2p

In-browser webrtc_websys can open stream, but can not accept stream from dialed peer (identify times out in golang basic host)

Open
#5,646 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Summary

While trying to implement(https://github.com/lat-murmeldjur/weeb-3) an in-browser wasm client (to ethswarm bee network), the following behaviour was encountered.
Dial to go-libp2p over webrtc-direct succeeds.
Can open custom handshake stream which succeeds.
After the handshake the other side tries to open a stream, which fails with identify failed: context timed out.
My in-browser node has identify behaviour, also tried manually accepting off-band identify streams, also tried triggering identify push manually from browser, however, the result is in each case the golang side failing with this line while trying to open a new stream.
Any help appreciated

Expected behavior

After .accept(P_PROTOCOL) and polling incoming streams, dialed node should be able to open stream towards browser node on the already existing connection.

Actual behavior

After .accept(P_PROTOCOL) and polling incoming streams, dialed (golang libp2p server) node times out with identify failed.

Relevant log output

No response

Possible Solution

Using websocket instead of webrtc with upgrade(V1), yamux and noise solved the issue. Is there a similar way to add a multiplexer to webrtc_websys transport?

Version

Latest git commit

Would you like to work on fixing this bug ?

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the browser-to-Go flow around webrtc_websys, then inspect go-libp2p's p2p/host/basic/basic_host.go at line 723 where stream opening times out. Compare the working websocket upgrade(V1), yamux, and noise path with the WebRTC transport. Done means the Go peer can open a stream toward the browser after the existing connection and identify exchange.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, rust, wasm
Domain
distributed-systems, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.