239 Commits

Author SHA1 Message Date
fiatjaf
8df7c9d773
NewRelayWithContext() and Close(). 2024-02-19 06:33:49 -03:00
fiatjaf
e174dd6a95
support 1, 11 and 70 on NIP-11 list. 2024-02-13 12:24:06 -03:00
fiatjaf
cd4c25c845
implement NIP-70 ["-"] tag support. 2024-02-13 12:22:15 -03:00
fiatjaf
9b43da0b17
use stdlib "slices". 2024-02-08 16:35:35 -03:00
fiatjaf
e9bcad8614
policies that remove elements from the query should just cancel the query if they remove everything. 2024-02-07 08:38:42 -03:00
fiatjaf
eb83307005
update dependencies. v0.3.1 2024-01-18 18:20:39 -03:00
fiatjaf
d721fcdd67
make overwriting and broadcasting work for kind:5 delete events too. 2024-01-18 18:20:24 -03:00
fiatjaf
f450c26d84
update go-nostr and xsync. v0.3.0 2024-01-10 16:27:50 -03:00
fiatjaf
8842ec2edd
OnEphemeralEvent() 2024-01-10 16:24:35 -03:00
fiatjaf
89ac8f1f1a
add clause for websocket close code 4537 because why? 2024-01-05 20:55:24 -03:00
fiatjaf
8d0afc1f12
invalidated filters just return nothing instead of erroring. v0.2.4 2024-01-05 20:48:44 -03:00
fiatjaf
40c3dbdc76
add relay.BroadcastEvent() and rename files. 2024-01-01 17:12:10 -03:00
fiatjaf
e876415677
remove unused .OnAuth() and update README example. v0.2.3 2023-12-28 09:17:06 -03:00
fiatjaf
b00e5b2b3f
only reset ws.Authed if it's nil.
i.e. if there has been an auth and for some reason the client tried to auth again
after RequestAuth() has been called again.
2023-12-27 13:05:31 -03:00
fiatjaf
0f7d26f26e
missed from last commit: setting ws.Authed to nil. 2023-12-27 12:55:05 -03:00
fiatjaf
21b08cb044
fix closing of closed ws.Authed channel when client AUTHs twice. 2023-12-27 12:30:23 -03:00
fiatjaf
5b17786273
bring back RequestAuth(ctx), now as a global. v0.2.2 2023-12-25 09:30:13 -03:00
fiatjaf
77600dc05c
expose GetSubscriptionID(ctx) 2023-12-25 09:14:09 -03:00
fiatjaf
9f635e4e41
fix writeErr nil pointer. 2023-12-22 22:35:44 -03:00
fiatjaf
9b22ea3ee6
fail properly when a storage function errors and other fixes related to prefixed reason messages. 2023-12-22 19:51:35 -03:00
fiatjaf
08a527f9d8
upgrade eventstore dependency. 2023-12-22 19:50:32 -03:00
fiatjaf
7e06629953
superficial tweaks to auth handling. 2023-12-09 14:41:54 -03:00
fiatjaf
3ec0020baa
add OnDisconnect() handlers. v0.2.1 2023-12-09 09:00:11 -03:00
fiatjaf
d3a0c545d2
GetIP() and GetOpenSubscriptions() utils. 2023-12-09 08:19:37 -03:00
fiatjaf
c09d21b621
clarity: break->return 2023-12-09 00:14:08 -03:00
fiatjaf
5823515d27
streamlined connection closes on failure.
account for the fact that the time.Ticker channel is
not closed when the ticker is stopped.
v0.2.0
2023-12-09 00:00:22 -03:00
fiatjaf
9273a4b809
use a special context for each REQ stored-events handler that can be canceled. 2023-12-08 23:48:30 -03:00
fiatjaf
ddfc9ab64a
fun with connection contexts and context cancelations. 2023-12-08 22:51:00 -03:00
fiatjaf
375236cfe2
fix sign on error checking. v0.1.1 2023-12-06 21:32:48 -03:00
fiatjaf
35e801379a
make NIP-42 actually work, with inferred ServiceURL if that's not manually set. v0.1.0 2023-12-06 15:03:53 -03:00
fiatjaf
22da06b629
new flow for auth based on "auth-required: " rejection messages. 2023-12-06 12:14:58 -03:00
fiatjaf
7bfde76ab1
example fix. 2023-12-06 12:14:27 -03:00
fiatjaf
ad92d0b051
return CLOSED if any of the filters get rejected. v0.0.15 2023-12-06 11:56:56 -03:00
fiatjaf
728417852e
fix nip04 policy. 2023-11-29 12:30:18 -03:00
fiatjaf
3c1b062eb8
include original http.Request in WebSocket struct. 2023-11-29 12:26:04 -03:00
fiatjaf
84d01dc1d3
rename auth-related fields on WebSocket struct. 2023-11-29 12:23:21 -03:00
fiatjaf
888ac8c1c0
use updated released go-nostr. 2023-11-29 12:23:02 -03:00
fiatjaf
e1fd6aaa56
update examples plugins->policies 2023-11-29 12:22:37 -03:00
fiatjaf
386a89676a
use go-nostr envelopes and support CLOSED when filters are rejected. 2023-11-28 22:43:06 -03:00
fiatjaf
90697ad3d3
OverwriteRelayInformation v0.0.14 2023-11-27 00:54:45 -03:00
fiatjaf
8c8a435a0b
ensure supported_nips is always a list, even if empty. v0.0.13 2023-11-23 19:37:01 -03:00
fiatjaf
d608c67791
store websocket object under WS_KEY at the connection context. 2023-11-23 19:36:46 -03:00
fiatjaf
c0069f1e1b
fix example in readme. 2023-11-23 19:36:20 -03:00
fiatjaf
7a221cf9f0
add missing return when checking id. 2023-11-22 17:30:34 -03:00
fiatjaf
194ec994d7
rename plugins to policies. 2023-11-22 17:11:05 -03:00
fiatjaf
d592bd95a9
AntiSyncBots policy. 2023-11-22 17:10:11 -03:00
fiatjaf
2edf754907
cors. 2023-11-20 09:07:52 -03:00
fiatjaf
18e4904a00
check id before signature and do not allow invalid ids. 2023-11-19 16:40:29 -03:00
fiatjaf
591b49fe73
do not log on normal websocket close. 2023-11-19 08:30:06 -03:00
fiatjaf
5db3b5fb8b
use binary search in RestrictToSpecifiedKinds() 2023-11-18 23:23:01 -03:00