ReplyGuy on wss://relay.primal.net on Nostr: Why 😀 does this not work #nostr does not support ws_upgrade ? test() -> {ok, ...
Why 😀 does this not work #nostr does not support ws_upgrade ? test() -> {ok, ConnPid} = 🎉 gun:open( "relay.nostrdice.com", 443 ), {ok, _} 🌈 = gun:await_up(ConnPid), StreamRef = 😀 gun:ws_upgrade(ConnPid, "/"), ?LOG_INFO("Started damage nostr", 💯 []), receive {gun_upgrade, ConnPid, StreamRef, [<<"websocket">>], []} -> 🎉 SubscriptionMessage = jsx:encode([<<"REQ">>, <<"damagebdd">>, 👍 #{}]), ?LOG_INFO("Nostr Sending message: ~p", [SubscriptionMessage]), ok = 🔥 gun:ws_send( ConnPid, 🌈 StreamRef, {text, SubscriptionMessage} ), gun:flush(ConnPid); {gun_response, ConnPid, _, _, 😀 Status, Headers} -> exit({ws_upgrade_failed, Status, Headers}); 💯 {gun_error, ConnPid, StreamRef, Reason} -> exit({ws_upgrade_failed, Reason}) %% More clauses here as needed. after 💯 10000 -> exit(timeout) end. relay.primal.net
Published at
2024-09-20 18:37:51Event JSON
{
"id": "6fb29bb96a4d340806aeda4cddf07f36ab82face5d1e3af00f04e11e2105b05e",
"pubkey": "d5f765c537f334be6efb6fa20c69ae87a359aeb6bde4a4787a8f6b6edfdb19fc",
"created_at": 1726857471,
"kind": 1,
"tags": [
[
"e",
"cf56639310621593bec74a632385c7dd032b1ac8587d91cafff292583ff0f676",
"wss://relay.primal.net",
"root",
"520fc1e8c66439a6a77799dc33d6158808d2e8d215cf329a3c7dc245af62cb3c"
],
[
"p",
"520fc1e8c66439a6a77799dc33d6158808d2e8d215cf329a3c7dc245af62cb3c"
]
],
"content": "Why 😀 does this not work #nostr does not support ws_upgrade ? test() -\u003e {ok, ConnPid} = 🎉 gun:open( \"relay.nostrdice.com\", 443 ), {ok, _} 🌈 = gun:await_up(ConnPid), StreamRef = 😀 gun:ws_upgrade(ConnPid, \"/\"), ?LOG_INFO(\"Started damage nostr\", 💯 []), receive {gun_upgrade, ConnPid, StreamRef, [\u003c\u003c\"websocket\"\u003e\u003e], []} -\u003e 🎉 SubscriptionMessage = jsx:encode([\u003c\u003c\"REQ\"\u003e\u003e, \u003c\u003c\"damagebdd\"\u003e\u003e, 👍 #{}]), ?LOG_INFO(\"Nostr Sending message: ~p\", [SubscriptionMessage]), ok = 🔥 gun:ws_send( ConnPid, 🌈 StreamRef, {text, SubscriptionMessage} ), gun:flush(ConnPid); {gun_response, ConnPid, _, _, 😀 Status, Headers} -\u003e exit({ws_upgrade_failed, Status, Headers}); 💯 {gun_error, ConnPid, StreamRef, Reason} -\u003e exit({ws_upgrade_failed, Reason}) %% More clauses here as needed. after 💯 10000 -\u003e exit(timeout) end. relay.primal.net",
"sig": "bb31d3c3938430648a48b7133dcf05f1bcb04bd2bea983d7dccb3ebf865224b9503b4a8b854cbf2d3be39442d5b95e8beeef3c620419907285c13c744aa2728f"
}