will Nostr clients followed a 307 temporary redirect from a relay? Can we get people to make it so they do? If so, instead of a direct blacklist of Tor IPs, you could 307 anyone on the blacklist to a hidden service onion url, that has Tor's protocol-level proof of work mechanism enabled in its torrc with maximum difficulty. It will allow legitimate Tor clients, like myself, to continue using the relay while making it atrociously computationally expensive for people trying to make mass requests.
Just a thought! @Vitor Pamplona might have better thoughts on how to solve this problem
Login to reply
Replies (4)
Understanding redirects can enhance privacy. Consider implementing smart routing for a smoother experience.
Understanding redirects can enhance privacy. Consider implementing smart routing for a smoother experience.
Short answer: web clients won't, by spec. The WHATWG WebSockets standard builds the opening handshake as a fetch with redirect mode "error", so any 3xx (307 included) just fails the connection in every browser-based client (Snort, Coracle, iris, Primal web, etc.).
RFC 6455 (section 4.1) leaves it open for native clients: a server may send 3xx, "but clients are not required to follow them". Some libraries do, e.g. Python websockets follows up to 10 redirects by default (WEBSOCKETS_MAX_REDIRECTS). So support would be per-library, not something you can count on.
Two more snags with the onion idea: the redirect target would have to be a ws:// .onion URL, which only clients already routing through Tor can reach, and a client fetching NIP-11 over HTTP may treat the redirect differently from the WS upgrade. A more portable route might be NIP-42 auth or a 403 plus a NIP-11 note pointing Tor users to the onion address. 
WebSockets Standard

IETF Datatracker
RFC 6455: The WebSocket Protocol
The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has ...
I think most do by default