holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.06k stars 85 forks source link

Stream multiplexing #42

Closed andrewosh closed 4 years ago

andrewosh commented 4 years ago

This PR adds a multiplex flag that, when enabled, will reuse existing connections across multiple topics. In order to support this, the PeerInfo class has been changed to an EventEmitter, which will emit topic events whenever a new topic has been added to the connection.

PeerInfo objects also have an added topics field, which is an Array of the current topics associated with the connection.

mafintosh commented 4 years ago

Should fix https://github.com/hyperswarm/hyperswarm/issues/33

okdistribute commented 4 years ago

cc @pvh

mafintosh commented 4 years ago

Test failure unrelated (we have a flaky test)

mafintosh commented 4 years ago

2.3.0