Open zacharygriffee opened 12 months ago
I've created a FORK of this repo that has the failing tests I'm mentioning. I'm going to see if I can fix the issue as well. But this is at a different direction of my expertise.
https://github.com/zacharygriffee/hyperswarm-dht-relay/blob/main/test/replication.mjs
I've found that this issue also breaks the new version of Autobase (version 6.x.x) for me in the browser.
Just wanted to say that I found a way to make this work in browser utilizing webrtc as the main connection through this npm library:
https://github.com/LuKks/hyper-webrtc
It still requires the use of dht-relay for peer discovery but then hands off to webrtc to handle direct browser connection.
I created a dht-relay server and added very heavy rate-limiting to only promote peer discovery to facilitate the browser connection.
This is working well, and replication of corestore, autobase, and other tools while simultaneously utilizing custom channels of my own work well now in the browser via the webrtc.
Hello! I originally posted this as an issue with corestore, but dug deep and found it was a hyperswarm-dht-relay issue.
When a corestore/core is replicated with protomux channels on a dht-relay websocket, it causes 'invalid reject/open' messages.
I have tried every variation of protomux <-> socket <-> replicate combinations and even tried with delays and 'using a channel to replicate the corestore/core after a delay'.
Here is a pastebin of the code that fails: https://pastebin.com/1NMCrgkK . The same code done over 'standard hyperdht' succeeds flawlessly.
This function of protomux https://github.com/holepunchto/protomux/blob/d3d6f8f55e52c2fbe5cd56f5d067ac43ca13c27d/index.js#L574 is where the error occurs as well as invalid open message.