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