update go-nostr and adjust user-agent stuff.

this changes the websocket library we were using.
This commit is contained in:
fiatjaf
2025-01-16 16:02:03 -03:00
parent 2d992f235e
commit 53a2451303
3 changed files with 14 additions and 14 deletions

View File

@@ -5,6 +5,8 @@ import (
"context"
"fmt"
"math/rand"
"net/http"
"net/textproto"
"net/url"
"os"
"strings"
@@ -23,7 +25,9 @@ var json = jsoniter.ConfigFastest
func init() {
sys.Pool = nostr.NewSimplePool(context.Background(),
nostr.WithUserAgent("nak/b"),
nostr.WithRelayOptions(
nostr.WithRequestHeader(http.Header{textproto.CanonicalMIMEHeaderKey("user-agent"): {"nak/b"}}),
),
)
}
@@ -134,7 +138,9 @@ func connectToAllRelays(
append(opts,
nostr.WithEventMiddleware(sys.TrackEventHints),
nostr.WithPenaltyBox(),
nostr.WithUserAgent("nak/s"),
nostr.WithRelayOptions(
nostr.WithRequestHeader(http.Header{textproto.CanonicalMIMEHeaderKey("user-agent"): {"nak/s"}}),
),
)...,
)