mirror of
https://github.com/vitorpamplona/Nostryfied.git
synced 2025-05-18 03:35:45 +00:00
add logs
This commit is contained in:
parent
4a01bfbc7f
commit
ffe7776345
@ -140,6 +140,8 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
|
|||||||
|
|
||||||
// Listen for messages
|
// Listen for messages
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
|
console.log("NEW Message", event)
|
||||||
|
|
||||||
const [msgType, subscriptionId, data] = JSON.parse(event.data)
|
const [msgType, subscriptionId, data] = JSON.parse(event.data)
|
||||||
// event messages
|
// event messages
|
||||||
if (msgType === 'EVENT') {
|
if (msgType === 'EVENT') {
|
||||||
@ -229,7 +231,6 @@ const fetchFromRelay = async (relay, filters, pubkey, events, relayStatus) =>
|
|||||||
|
|
||||||
if (msgType === 'OK') {
|
if (msgType === 'OK') {
|
||||||
// auth ok.
|
// auth ok.
|
||||||
console.log("AUTH", JSON.stringify(['EVENT', event]))
|
|
||||||
for (const [key, sub] of Object.entries(subscriptions)) {
|
for (const [key, sub] of Object.entries(subscriptions)) {
|
||||||
ws.send(JSON.stringify(['REQ', sub.id, sub.filter]))
|
ws.send(JSON.stringify(['REQ', sub.id, sub.filter]))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user