Skip to content

Checking for WebSockets constructor name fails under uglification #65

@jackkleeman

Description

@jackkleeman

Currently to add the WebSockets transport index.js does a check for the constructor.name being 'WebSockets'. This fails under uglification unless 'WebSockets' is made a reserved word in the uglify config, as constructor names are one of the things uglify removes. I recommend that either this is documented, or a different solution is devised; there is already a TODO in the code suggesting that this is found. For example, we could standardise some kind of boolean flag in a transport class which tells libp2p to include it even if there are no listening addresses. That wouldn't be websocket-specific, and wouldn't require checking the name against a string.

Metadata

Metadata

Assignees

Labels

exp/expertHaving worked on the specific codebase is importantexplorationhelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions