write TODO list and TypeScript map format has changed
This commit is contained in:
39
main.go
39
main.go
@@ -1,3 +1,41 @@
|
||||
// TODO
|
||||
// 1. Convery network messages to flatbuffers so we don't need to parse JSON in Go.
|
||||
// Use binary WS messages. Generate for Go and JS and use that everywhere. We can
|
||||
// also use this for WebRTC messages.
|
||||
// 2. Keep a list of all nodes that bootstrapped in the last N minutes.
|
||||
// 3. When a node bootstraps, send it a random list of the nodes we know about.
|
||||
// 4. Do the signalling to connect those nodes.
|
||||
// 5. Each node will know about N other nodes. To find get the data for a feed,
|
||||
// a node will need to find another node that has that data. To do that we'll need to
|
||||
// implement a search message that is sent to all currently connected nodes, and they
|
||||
// forward to all their nodes, passing back the address of the node that has the data.
|
||||
// Once we find it, we'll do the signalling to connect to it via Web RTC via our existing connected nodes.
|
||||
// -----
|
||||
// Feeds. People can curate feeds which can be any combination of hashtags, serch terms and users.
|
||||
// Invite-only communities. Just block everyone else even if they post to it.
|
||||
// Limit to friends and friends of friends
|
||||
|
||||
// MVP
|
||||
// You connect to the person you want to get the post from to get the post
|
||||
// they give you the post
|
||||
// If they're offline, you can't get their updates.
|
||||
// This is very stupid, but it's simplest thing.
|
||||
// The bootstrap server connects you to them directly via WebRTC
|
||||
// This will make the thing actually function as a little toy for people to play with.
|
||||
// This will let us test whether background tabs respond to webrtc requests.
|
||||
|
||||
// THEN
|
||||
// Need to have identity sorted out
|
||||
// When you read someone's posts, you also cache them locally
|
||||
// cache priority goes mutuals->people you follow->people who you folllow, follow, so you're always
|
||||
// caching your mutual's posts
|
||||
// Posts are samll, so caching per-post will work fine.
|
||||
// Then the process is for the bootstrap server to remember all nodes and what they're caching
|
||||
// This will allow distributed content delivery but put a memory and bendwidth strain on the
|
||||
// bootstrap sever. Look into Web Transport for the raspberry pi overhead. Could buy a few more RPIs
|
||||
// and make a little cluster
|
||||
// Domain name so we can get a certificate and serve HTTPS / HTTP3
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -34,6 +72,7 @@ func handleWebSocket(w http.ResponseWriter, r *http.Request) {
|
||||
break
|
||||
}
|
||||
log.Printf("recv: %s", message)
|
||||
|
||||
err = conn.WriteMessage(mt, message)
|
||||
if err != nil {
|
||||
log.Println("Write error:", err)
|
||||
|
||||
Reference in New Issue
Block a user