quotingWhy does this not work #nostr does not support ws_upgrade ?
nevent1q…5vkj
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.
asyncmind on Nostr: #nostr uses http1 websockets? Any relays with http2 support ? ...
#nostr uses http1 websockets? Any relays with http2 support ?