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() πŸ‘ -> {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
npub1h6zeelfp9wvp88pwe4srq0qexrv45nfdtpddecs2sg5jyd59px9q2vhezc