What is Nostr?
derGigi โšก๐Ÿงก
npub12g8โ€ฆe3sq
2024-09-20 18:37:50

derGigi โšก๐Ÿงก 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.
Author Public Key
npub12g8ur6xxvsu6dfmhn8wr84s43qyd96xjzh8n9x3u0hpyttmzev7qwye3sq