mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
some small fixes.
This commit is contained in:
6
relay.js
6
relay.js
@@ -29,9 +29,7 @@ export function relayConnect(url, onNotice) {
|
||||
var channels = {}
|
||||
|
||||
function connect() {
|
||||
ws = new WebSocket(
|
||||
url + (url.indexOf('?') !== -1 ? '&' : '?') + `session=${Math.random()}`
|
||||
)
|
||||
ws = new WebSocket(url)
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log('connected to', url)
|
||||
@@ -135,7 +133,7 @@ export function relayConnect(url, onNotice) {
|
||||
url,
|
||||
sub: R.partial(sub, [sha256(Math.random().toString())]),
|
||||
async publish(event) {
|
||||
trySend(JSON.stringify(event))
|
||||
trySend(JSON.stringify(['EVENT', event]))
|
||||
},
|
||||
close() {
|
||||
ws.close()
|
||||
|
||||
Reference in New Issue
Block a user