Skip to content

No way to restrict to only WSS and exclude WS #796

Closed
@georgyo

Description

@georgyo

Type: Enhancement

Severity: Medium

Description:

When using IPFS with dht enabled from a address that is not local host, the browser makes it impossible to open connections to not TLS websockets.

As a result, you end up with thousands of failed attempts to contact hosts the browser will reject, flooding the console.

The transports section of js-libp2p takes a module of https://github.com/libp2p/js-libp2p-websockets, which is maybe where this bug report should have ended up.

There also seems to be a heavy performance penalty as throughput plummets, even when directly attached to nodes that have the content. Though I need to debug this further.

Steps to reproduce the error:

Spawn an IPFS node with at least the following config and try visiting it from a website using TLS:

  libp2p: {
    config: {
      dht: {
        enabled: true,
        clientMode: true
      }
    }
  },

This is easily seen here: https://bafybeihxe5lmiyonwlh4yxb7o5wthq7lwrd366orvj5urmcuhfmrlc65ca.ipfs.dweb.link/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions