mleku on Nostr: relays are not really web servers, they don't serve web apps or web pages, they are ...
relays are not really web servers, they don't serve web apps or web pages, they are more like microservices attached to a database with a simple protocol
they *can* serve web pages, in fact i am in the process of adding some web service features on a secondary, local-only port for administrators to dump the event store and push events up to it without restarting the relay (dumping the DB was easy, adding events will be a tiny bit more complex) and i could easily add more web services to it if i could be bothered
the nostrudel client attempts to connect to the relay's listener as a simple webserver on its / route and it is possible to put a web app onto this port, for such things as serving up a statistics page or a subscription system, nostr wine and nostr.land i think both have little web pages for this that let you bump your subscription and suchlike
other big differences from a web server is these things called "ephemeral events" and the auth envelope is an example of one, this lets you identify yourself to an npub to the relay which can alter the data it will allow you to access or publish, this is all in a separate protocol from a standard web service, it is more like a microservice, microservices commonly use JSON protocols, but more usually actually JSONRPC2 or Swagger or similar protocols, it really is its own protocol and it's not and is not first class web server it is actually a websocket server
because it can auth in the socket and this can grant you different rights of access to data there is a lot more potential for mitigating attempts to surveill or stop the propagation of data, and this is the what the fuss is all about
websockets essentially let you run something that behaves like a webserver, but if you upgrade, or send other header fields, it can do other things, like the nostr+json which lets you access the relay's nip-11 metadata
calling relays "just a web server" totally misses most of the things that they actually do on a daily, minute by minute basis... and i run mine from my home, with the help of a reverse proxy and wireguard server, and it would be nothing at all to change that so the vps is in other jurisdictions and the actual relay itself is running anywhere, even probably (if i modified my reverse proxy) i could round robin it across multiple endpoints and have them quietly synchronising in the back end, which is just the beginning of the possibilities for making relays resistant to attacks from well equipped adversaries
they *can* serve web pages, in fact i am in the process of adding some web service features on a secondary, local-only port for administrators to dump the event store and push events up to it without restarting the relay (dumping the DB was easy, adding events will be a tiny bit more complex) and i could easily add more web services to it if i could be bothered
the nostrudel client attempts to connect to the relay's listener as a simple webserver on its / route and it is possible to put a web app onto this port, for such things as serving up a statistics page or a subscription system, nostr wine and nostr.land i think both have little web pages for this that let you bump your subscription and suchlike
other big differences from a web server is these things called "ephemeral events" and the auth envelope is an example of one, this lets you identify yourself to an npub to the relay which can alter the data it will allow you to access or publish, this is all in a separate protocol from a standard web service, it is more like a microservice, microservices commonly use JSON protocols, but more usually actually JSONRPC2 or Swagger or similar protocols, it really is its own protocol and it's not and is not first class web server it is actually a websocket server
because it can auth in the socket and this can grant you different rights of access to data there is a lot more potential for mitigating attempts to surveill or stop the propagation of data, and this is the what the fuss is all about
websockets essentially let you run something that behaves like a webserver, but if you upgrade, or send other header fields, it can do other things, like the nostr+json which lets you access the relay's nip-11 metadata
calling relays "just a web server" totally misses most of the things that they actually do on a daily, minute by minute basis... and i run mine from my home, with the help of a reverse proxy and wireguard server, and it would be nothing at all to change that so the vps is in other jurisdictions and the actual relay itself is running anywhere, even probably (if i modified my reverse proxy) i could round robin it across multiple endpoints and have them quietly synchronising in the back end, which is just the beginning of the possibilities for making relays resistant to attacks from well equipped adversaries