Alternative federation transport
Right now, federation mostly works by POSTing to other servers inboxes with a signed version of the AP json. This is rather costly, because it involves:
- Signing the JSON
- Establishing and HTTP connection
- Sending the data
- Closing the HTTP connection
Depending on your setup, the connection can sometimes be used again from the pool, so only the signing part remains.
When I post something on soykaf, it will federate to nearly a thousand servers and will take a long time because of that.
It would be good to have an alternative transport that keeps a connection between servers and authenticates the connection itself, not the specific request, so that we can send the same json to all servers connected this way.
One obvious way for us would be to use phoenix channels, which already have this kind of authentication system built in. Another way would be to just do another custom websocket protocol for this, which should not be too hard either. Pure TCP or UDP could make sense, but would probably be hard to implement for other servers and would involve opening more ports.