What is Nostr?
Ron Stoner
npub1h6z…hezc
2024-09-20 18:37:47
in reply to nevent1q…0y5u

Ron Stoner 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.
Author Public Key
npub1h6zeelfp9wvp88pwe4srq0qexrv45nfdtpddecs2sg5jyd59px9q2vhezc