This is a simple example module that can be used as a reference for making your own, customized
super peer sync servers.
It uses Deno's HTTP server and Deno KV for super peer storage.
You can use it by running this module directly with Deno, i.e. it can be used as the "main"
module, and it will start a server, reading the PORT and DB_FILE environment variables to
configure the HTTP port and path to the Sqlite database used for storage.
You can also use the handleRequest function in your own Deno server if you want more
control over how the connections are opened or need to add, for example, authentication, or use
with your own SuperPeer1.
Finally you can use the startServer function if you don't want to implement the
server yourself, but you would like to be able to start it from your own script.
This whole module is tiny and meant to stay simple and serve as a useful reference. Most people
will probably want to use it as an example and make something custom.
WebSocket server implementation of a SuperPeer1.
This is a simple example module that can be used as a reference for making your own, customized super peer sync servers.
It uses Deno's HTTP server and Deno KV for super peer storage.
You can use it by running this module directly with Deno, i.e. it can be used as the "main" module, and it will start a server, reading the
PORT
andDB_FILE
environment variables to configure the HTTP port and path to the Sqlite database used for storage.You can also use the
handleRequest
function in your own Deno server if you want more control over how the connections are opened or need to add, for example, authentication, or use with your own SuperPeer1.Finally you can use the
startServer
function if you don't want to implement the server yourself, but you would like to be able to start it from your own script.This whole module is tiny and meant to stay simple and serve as a useful reference. Most people will probably want to use it as an example and make something custom.