From d34fc616e76c364fe5b25aa46609d58dffbe468d Mon Sep 17 00:00:00 2001 From: Ricardo Arturo Cabral Mejia Date: Mon, 31 Jan 2022 21:55:40 +0000 Subject: [PATCH] feat: add relays over Tor --- main.js | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/main.js b/main.js index 4ed6b88..6440fb6 100644 --- a/main.js +++ b/main.js @@ -1,24 +1,32 @@ import {createApp, h} from 'vue' import {relayConnect} from 'nostr-tools/relay' +const isUsingTor = () => window.location.hostname.endsWith('.onion') + +const clearnetRelays = [ + 'wss://nostr-pub.wellorder.net', + 'wss://relayer.fiatjaf.com', + 'wss://nostr.rocks', + 'wss://rsslay.fiatjaf.com', + 'wss://nostr-relay.herokuapp.com', + "wss://freedom-relay.herokuapp.com/ws", + "wss://nodestr-relay.dolu.dev/ws", + "wss://nostrrr.bublina.eu.org", + "wss://nostr-relay.freeberty.net", + "wss://nostr.bitcoiner.social", + "wss://nostr-relay.wlvs.space", + "wss://nostr.onsats.org", + "wss://nostr-relay.untethr.me" +] + +const torRelays = [ + 'ws://jgqaglhautb4k6e6i2g34jakxiemqp6z4wynlirltuukgkft2xuglmqd.onion' +] + const App = { data() { return { - relays: [ - 'wss://nostr-pub.wellorder.net', - 'wss://relayer.fiatjaf.com', - 'wss://nostr.rocks', - 'wss://rsslay.fiatjaf.com', - 'wss://nostr-relay.herokuapp.com', - "wss://freedom-relay.herokuapp.com/ws", - "wss://nodestr-relay.dolu.dev/ws", - "wss://nostrrr.bublina.eu.org", - "wss://nostr-relay.freeberty.net", - "wss://nostr.bitcoiner.social", - "wss://nostr-relay.wlvs.space", - "wss://nostr.onsats.org", - "wss://nostr-relay.untethr.me" - ], + relays: isUsingTor() ? torRelays : clearnetRelays, status: {} } },