diff --git a/package.json b/package.json index 348609f..52b9c65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nostr-tools", - "version": "0.1.4", + "version": "0.2.0", "description": "Tools for making a Nostr client.", "main": "index.js", "repository": { @@ -9,8 +9,7 @@ }, "dependencies": { "buffer": "^6.0.3", - "noble-secp256k1": "^1.1.1", - "pws": "^5.0.2" + "noble-secp256k1": "^1.1.1" }, "keywords": [ "decentralization", diff --git a/relay.js b/relay.js index 88f1c5d..b8776b0 100644 --- a/relay.js +++ b/relay.js @@ -1,4 +1,3 @@ -import PersistentWebSocket from 'pws' import {verifySignature} from './event' export function normalizeRelayURL(url) { @@ -12,7 +11,7 @@ export function normalizeRelayURL(url) { export function relayConnect(url, onEvent, onNotice) { url = normalizeRelayURL(url) - const ws = new PersistentWebSocket( + const ws = new WebSocket( url + (url.indexOf('?') !== -1 ? '&' : '?') + `session=${Math.random()}`, { pingTimeout: 180 * 1000 diff --git a/yarn.lock b/yarn.lock index 9ba167b..4fece1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1165,11 +1165,6 @@ picomatch@^2.2.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== -pws@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/pws/-/pws-5.0.2.tgz#86b581ad5e811417d514f06868ae4d9c71bdaa48" - integrity sha512-V4ZwsJIAiG9YoNv1IO/JSoapG9NrwRhmKKdQ0C7q0tBIxBTptGeTBhdnE53o5qrcoEHDqw5Mc3T1XF0NlvHTlQ== - randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"