Skip to content

Commit 7632655

Browse files
committed
fix negentropy support and special dufflepud trick.
1 parent 253a75e commit 7632655

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"embed"
66
"errors"
7-
"fmt"
87
"iter"
98
"net"
109
"net/http"
@@ -70,6 +69,7 @@ func main() {
7069
relay = khatru.NewRelay()
7170
relay.Info.Name = "main" // for debugging purposes
7271
relay.ServiceURL = global.Settings.WSScheme() + global.Settings.Domain
72+
relay.Negentropy = true
7373

7474
// init sdk
7575
global.Nostr = sdk.NewSystem()
@@ -265,10 +265,8 @@ func main() {
265265
relay.ManagementAPI.BlockIP = blockIPHandler
266266
relay.ManagementAPI.UnblockIP = unblockIPHandler
267267
relay.OverwriteRelayInformation = func(ctx context.Context, r *http.Request, info nip11.RelayInformationDocument) nip11.RelayInformationDocument {
268-
fmt.Println("NIP11 request:", r.Header.Get("User-Agent"), r.Header.Get("X-Forwarded-For"), r.Header.Get("Referer"))
269-
270268
if strings.Contains(r.Header.Get("User-Agent"), "aiohttp") {
271-
if idx := slices.Index(info.SupportedNIPs, 29); idx != -1 {
269+
if idx := slices.Index(info.SupportedNIPs, 77); idx != -1 {
272270
info.SupportedNIPs[idx] = info.SupportedNIPs[len(info.SupportedNIPs)-1]
273271
info.SupportedNIPs = info.SupportedNIPs[0 : len(info.SupportedNIPs)-1]
274272
}

0 commit comments

Comments
 (0)