Global Feed Post Login
Replying to Avatar brugeman

Actually there is a "browser relay", Snort has it, Spring browser too. Not sure about Snort, with Spring it's a fake Websocket interface installed to global that will redirect all requests to a custom "local-relay" url to a relay running in a service worker. There's a dumb relay in sw now, which I didn't bother to make efficient yet, but it can be improved. The main limitation is browser js performance and storage size limits, I guess.

But this is only for your own app. If you wanted to share this relay, that's possible too using postMessage for cross-origin communication (with the same fake websocket installed in the app to trick the libs it's using (ndk/nostr-tools) to use the local relay). Haven't tried it though, there a limitation will probably be that the relay tab must be kept open.

Avatar
brugeman 1y ago

Actually, an app could open an invisible iframe and talk to it using postMessage, then no need for an open tab, the relay would live in the iframe's service worker. Could be pretty cool!

Reply to this note

Please Login to reply.

Discussion

No replies yet.