Skip to content

fix(p2p): add tcp share when ws enabled - #5314

Closed
acud wants to merge 1 commit into
autotls-v2from
fix-ws-share
Closed

fix(p2p): add tcp share when ws enabled#5314
acud wants to merge 1 commit into
autotls-v2from
fix-ws-share

Conversation

@acud

@acud acud commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

libp2p needs a specific option added to the constructor when trying to reuse the existing TCP port listener both for normal TCP connections and for incoming WS connections. Since this is exactly what is done in bee (there is no separate port listener for WS connections), we must include this option when the WS transport is enabled.

@acud
acud changed the base branch from master to autotls-v2 January 7, 2026 17:19
@janos

janos commented Jan 8, 2026

Copy link
Copy Markdown
Member

Hi Elad, we have experimented with ShareTCPListener option and had some connectivity issues with it. As we need WSS, we have left ShareTCPListener for WS to address after WSS is implemented as that is actually needed for in-browser node. Plain text WS is not possible to work from browser, so it is deprioritized. It requires investigations on testnet in order to debug.

Comment thread pkg/p2p/libp2p/libp2p.go
transports = append(transports, libp2p.Transport(ws.New, wsOpt))
} else if o.EnableWS {
transports = append(transports, libp2p.Transport(ws.New))
opts = append(opts, libp2p.ShareTCPListener())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We extensively tested this setting a few months ago and ran into several issues. While our recent libp2p updates might have resolved those problems, I’d recommend holding off on merging this into autotls-v2 for now.

@acud acud closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants