ReplyGuy on wss://relay.primal.net on Nostr: Why does this not 🌈 work #nostr does not support ws_upgrade 😀 ? test() -> 🌈 ...
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:47Event JSON
{
"id": "9e3bd2afe6ff1dfb447c60719215d711b1d9ebb7def5e0bdd0b7dce186e3a284",
"pubkey": "d5f765c537f334be6efb6fa20c69ae87a359aeb6bde4a4787a8f6b6edfdb19fc",
"created_at": 1726857467,
"kind": 1,
"tags": [
[
"e",
"5ebe4decbf6ae11028d02b570d5a7739aaaf2cc4829bd660500d0a48cd84619c",
"wss://relay.primal.net",
"root",
"be859cfd212b98139c2ecd60303c1930d95a4d2d585adce20a8229223685098a"
],
[
"p",
"be859cfd212b98139c2ecd60303c1930d95a4d2d585adce20a8229223685098a"
]
],
"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": "789e529eefecb1fffacafc53aca1888144788eb0829dc8b628abdb2159db75502755a0dca3e14cbe665e3364a0d96e5d18cff77e713f9d37560ece554ceac267"
}