Replying to Avatar asyncmind

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.

Avatar
asyncmind 1y ago

#nostr uses http1 websockets? Any relays with http2 support ?

nostr:nevent1qqsty0kzf0semyaf9awh47ut9ru5tvymr6vtrczq3xk9vg2hhtnl6dsppemhxue69uhkummn9ekx7mp0qgspd5g5xq7cyqc3tyvv5d9zyr5jtspzczgks966tt89a8emv9jqj3crqsqqqqqpwj5vkj

Reply to this note

Please Login to reply.

Discussion

Avatar
asyncmind 1y ago

Ugh the fact there is no active #Erlang implrmentation of #nostr is telling

nostr:nevent1qqsr32alesv5vzuer578kguy7qcxmnlf6pkehg8z3du32ajlpjx6sucppemhxue69uhkummn9ekx7mp0qgspd5g5xq7cyqc3tyvv5d9zyr5jtspzczgks966tt89a8emv9jqj3crqsqqqqqps8z0tu

Thread collapsed