holepunchto / hypercore

Hypercore is a secure, distributed append-only log.
https://docs.holepunch.to
MIT License
2.53k stars 185 forks source link

Hypercore.createProtocolStream(protomux) returns NoiseSteam, not the raw stream #448

Open gmaclennan opened 8 months ago

gmaclennan commented 8 months ago

Hypercore.createProtocolStream() has slightly different behaviour when you pass it a Protomux instance instead of a raw duplex stream or a noise stream: in the latter cases it returns the raw outer stream (e.g. the noiseStream.rawStream), but when you pass a protomux instance it returns the noise stream. Not something that comes up much, but it's confusing.

mafintosh commented 8 months ago

It should always return the rawstream, will fix