RangerMauve / hyperswarm-web

Implementation of the hyperswarm API for use in web browsers
MIT License
102 stars 15 forks source link

Internal signal server seems to be overshadowed by proxy handler #20

Open telamon opened 2 years ago

telamon commented 2 years ago

Hey! I wanted to set up a signal-server + static file serving combo, but while sewing together the two pieces I noticed that the condition here: https://github.com/RangerMauve/hyperswarm-web/blob/ed7f909df767dd065e99dd449e8020c7bd1cc799/server.js#L22 never evaluates to true..

Digging further i figured I had missed some client configuration and half-expected a /signal suffix in the webrtc test: https://github.com/RangerMauve/hyperswarm-web/blob/ed7f909df767dd065e99dd449e8020c7bd1cc799/test.js#L89

But that dosen't seem to be the case. So after modifying server.js to unconditionally handover the upgrade event to the signal instance I ran into a completely different issue; (Messages from browser cannot be decoded by the signal-server)

After lots of headscratching I inspected the webrtc message stream and noticed the only live signal server that seems to work properly is the one deployed at wss://geut-webrtc-signal-v3.herokuapp.com/ My only explanation for how my application works at all is that the the Geut signal server acts as a broker or there's some dual tunneling going on via the proxies.

I suspect the same issue exists in the aforementioned test; Haven't tried running it with wifi/cable unplugged. :man_shrugging:

So my last attempt at a sanity-check was to replicate the Geut's service via:

DEBUG=* npx @geut/discovery-swarm-webrtc -p 4977

Console spits out decode-errors, browser request is stuck at "pending".

I don't get it, what code are geut running on their heroku? :zipper_mouth_face:

RangerMauve commented 2 years ago

cc @tinchoz49 any idea what might be up with this? 😅

tinchoz49 commented 2 years ago

Hey @RangerMauve @telamon how are you? I'm on vacations right now but next week I will check what's going on, it's been a while since I check the default signals running in heroku :smile:

telamon commented 2 years ago

@RangerMauve thanks @tinchoz49 In retrospect I might have bamboozled myself yesterday but otherwise i'm good =) I don't know what's the is issue is at the moment but i hope to dig a bit deeper later, enjoy your vacay! :grin: