bobbyd-show-single-post #1
@@ -293,7 +293,7 @@ function connectWebsocket(request: Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function devServerWatchFiles() {
|
async function devServerWatchFiles() {
|
||||||
const watcher = Deno.watchFs("../static/");
|
const watcher = Deno.watchFs(["../static/", "../src/"]);
|
||||||
for await (const event of watcher) {
|
for await (const event of watcher) {
|
||||||
if (event.kind === "modify") {
|
if (event.kind === "modify") {
|
||||||
for (const path of event.paths) {
|
for (const path of event.paths) {
|
||||||
@@ -320,6 +320,10 @@ function handler(request: Request, info: any): Promise<Response> | Response {
|
|||||||
return new Response("Not serving video", { status: 404 });
|
return new Response("Not serving video", { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (url.pathname.includes("/src")) {
|
||||||
|
return serveFile(url.pathname);
|
||||||
|
}
|
||||||
|
|
||||||
if (url.pathname === "/") {
|
if (url.pathname === "/") {
|
||||||
return serveFile("/static/index.html")
|
return serveFile("/static/index.html")
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/App.ts
23
src/App.ts
@@ -60,7 +60,7 @@ class StatusBar {
|
|||||||
peerStatus = new Map();
|
peerStatus = new Map();
|
||||||
headless = false;
|
headless = false;
|
||||||
|
|
||||||
setMessageHTML(html:string) {
|
setMessageHTML(html: string) {
|
||||||
let statusBarElement = document.getElementById('status_bar');
|
let statusBarElement = document.getElementById('status_bar');
|
||||||
|
|
||||||
if (!statusBarElement) {
|
if (!statusBarElement) {
|
||||||
@@ -71,24 +71,24 @@ class StatusBar {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setHeadless(headless:boolean) {
|
setHeadless(headless: boolean) {
|
||||||
this.headless = headless;
|
this.headless = headless;
|
||||||
}
|
}
|
||||||
updatePeerMessage(peerID: string, message: string) {
|
updatePeerMessage(peerID: string, message: string) {
|
||||||
this.peerStatus.set(peerID, {message, data:this.peerStatus.get(peerID)?.data});
|
this.peerStatus.set(peerID, { message, data: this.peerStatus.get(peerID)?.data });
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePeerData(peerID:PeerID, data:any) {
|
updatePeerData(peerID: PeerID, data: any) {
|
||||||
this.peerStatus.set(peerID, {message:this.peerStatus.get(peerID)?.message, data:data});
|
this.peerStatus.set(peerID, { message: this.peerStatus.get(peerID)?.message, data: data });
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePeerStatus(peerID:PeerID, message:string="", data={}) {
|
updatePeerStatus(peerID: PeerID, message: string = "", data = {}) {
|
||||||
this.peerStatus.set(peerID, {message, data});
|
this.peerStatus.set(peerID, { message, data });
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
getPeerData(peerID:PeerID) {
|
getPeerData(peerID: PeerID) {
|
||||||
let status = this.peerStatus.get(peerID);
|
let status = this.peerStatus.get(peerID);
|
||||||
if (status) {
|
if (status) {
|
||||||
return status.data;
|
return status.data;
|
||||||
@@ -187,7 +187,7 @@ export class App {
|
|||||||
if (neededPostIDs.length > 0) {
|
if (neededPostIDs.length > 0) {
|
||||||
console.log.apply(null, log(`[app] Need (${neededPostIDs.length}) posts for user ${logID(userID)} from peer ${logID(peerID)}`));
|
console.log.apply(null, log(`[app] Need (${neededPostIDs.length}) posts for user ${logID(userID)} from peer ${logID(peerID)}`));
|
||||||
let neededPostCount = neededPostIDs.length;
|
let neededPostCount = neededPostIDs.length;
|
||||||
this.statusBar.updatePeerStatus(peerID, `need(${logID(userID)} | ${neededPostCount})`, {havePostCount:0, neededPostCount:neededPostCount});
|
this.statusBar.updatePeerStatus(peerID, `need(${logID(userID)} | ${neededPostCount})`, { havePostCount: 0, neededPostCount: neededPostCount });
|
||||||
|
|
||||||
let neededPosts = await this.peerManager?.rpc.getPostsForUser(peerID, this.peerID, userID, neededPostIDs);
|
let neededPosts = await this.peerManager?.rpc.getPostsForUser(peerID, this.peerID, userID, neededPostIDs);
|
||||||
}
|
}
|
||||||
@@ -272,8 +272,9 @@ export class App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let knownUsers = await this.sync.getKnownUsers();
|
let knownUsers = await this.sync.getKnownUsers();
|
||||||
this.peerManager.rpc.announceUsers(event.peerID, this.peerID, knownUsers);
|
|
||||||
// rpc saying what peers we have
|
// rpc saying what peers we have
|
||||||
|
this.peerManager.rpc.announceUsers(event.peerID, this.peerID, knownUsers);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.peerManager.addEventListener(PeerEventTypes.PEER_DISCONNECTED, async (event: any) => {
|
this.peerManager.addEventListener(PeerEventTypes.PEER_DISCONNECTED, async (event: any) => {
|
||||||
@@ -310,7 +311,7 @@ export class App {
|
|||||||
this.peerManager.registerRPC('getPostsForUser', async (requestingPeerID: string, userID: string, postIDs: string[]) => {
|
this.peerManager.registerRPC('getPostsForUser', async (requestingPeerID: string, userID: string, postIDs: string[]) => {
|
||||||
let posts = await this.sync.getPostsForUser(userID, postIDs);
|
let posts = await this.sync.getPostsForUser(userID, postIDs);
|
||||||
|
|
||||||
let i=0;
|
let i = 0;
|
||||||
for (let post of posts) {
|
for (let post of posts) {
|
||||||
console.log.apply(null, log(`[app] sendPostForUser sending post [${logID(post.post_id)}] to [${logID(requestingPeerID)}]`, userID, post.author, post.text));
|
console.log.apply(null, log(`[app] sendPostForUser sending post [${logID(post.post_id)}] to [${logID(requestingPeerID)}]`, userID, post.author, post.text));
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import { generateID } from "IDUtils";
|
import { generateID } from "IDUtils";
|
||||||
import { log, logID } from "log";
|
import { log, logID } from "log";
|
||||||
import { App } from "./App";
|
// import { App } from "./App";
|
||||||
|
|
||||||
// Use a broadcast channel to only have one peer manager for multiple tabs,
|
// Use a broadcast channel to only have one peer manager for multiple tabs,
|
||||||
// then we won't need to have a session ID as all queries for a peerID will be coming from the same peer manager
|
// then we won't need to have a session ID as all queries for a peerID will be coming from the same peer manager
|
||||||
@@ -26,7 +26,7 @@ export class PeerManager {
|
|||||||
searchQueryFunctions: Map<string, Function> = new Map();
|
searchQueryFunctions: Map<string, Function> = new Map();
|
||||||
RPC_remote: Map<string, Function> = new Map();
|
RPC_remote: Map<string, Function> = new Map();
|
||||||
rpc: { [key: string]: Function } = {};
|
rpc: { [key: string]: Function } = {};
|
||||||
isBootstrapPeer: boolean = false;
|
_isBootstrapPeer: boolean = false;
|
||||||
bootstrapPeerConnections: Map<string, PeerConnection> | null = null;
|
bootstrapPeerConnections: Map<string, PeerConnection> | null = null;
|
||||||
sessionID = generateID();
|
sessionID = generateID();
|
||||||
userID: string;
|
userID: string;
|
||||||
@@ -84,6 +84,11 @@ export class PeerManager {
|
|||||||
return peername;
|
return peername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isBootstrapPeer(peerID: string) {
|
||||||
|
return this.bootstrapPeerIDs?.has(peerID)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
websocketSend(message: any) {
|
websocketSend(message: any) {
|
||||||
if (!this.websocket) {
|
if (!this.websocket) {
|
||||||
throw new Error();
|
throw new Error();
|
||||||
@@ -118,7 +123,7 @@ export class PeerManager {
|
|||||||
|
|
||||||
if (message.type === "hello2") {
|
if (message.type === "hello2") {
|
||||||
|
|
||||||
if (!this.isBootstrapPeer && Array.isArray(message?.bootstrapPeers)) {
|
if (!this._isBootstrapPeer && Array.isArray(message?.bootstrapPeers)) {
|
||||||
this.bootstrapPeerIDs = new Set(message.bootstrapPeers);
|
this.bootstrapPeerIDs = new Set(message.bootstrapPeers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +149,7 @@ export class PeerManager {
|
|||||||
if (!peerConnection) {
|
if (!peerConnection) {
|
||||||
let remotePeerID = message.from;
|
let remotePeerID = message.from;
|
||||||
let newPeer = new PeerConnection(this, remotePeerID, this.websocketSendPeerMessage.bind(this));
|
let newPeer = new PeerConnection(this, remotePeerID, this.websocketSendPeerMessage.bind(this));
|
||||||
if (this.isBootstrapPeer) {
|
if (this._isBootstrapPeer) {
|
||||||
newPeer.setPolite(false);
|
newPeer.setPolite(false);
|
||||||
}
|
}
|
||||||
peerConnection = newPeer;
|
peerConnection = newPeer;
|
||||||
@@ -177,7 +182,7 @@ export class PeerManager {
|
|||||||
|
|
||||||
async onHello2Received(bootstrapPeerIDs: Set<string> | null) {
|
async onHello2Received(bootstrapPeerIDs: Set<string> | null) {
|
||||||
|
|
||||||
if (this.isBootstrapPeer) {
|
if (this._isBootstrapPeer) {
|
||||||
this.connectPromiseCallbacks?.resolve();
|
this.connectPromiseCallbacks?.resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -195,7 +200,7 @@ export class PeerManager {
|
|||||||
// this.bootstrapPeerConnection = await this.connectToPeer(peerID);
|
// this.bootstrapPeerConnection = await this.connectToPeer(peerID);
|
||||||
|
|
||||||
|
|
||||||
let bootstrapPeerConnectionPromise = new Promise( async (resolve, reject)=>{
|
let bootstrapPeerConnectionPromise = new Promise(async (resolve, reject) => {
|
||||||
let peerConnection = await this.connectToPeer(peerID);
|
let peerConnection = await this.connectToPeer(peerID);
|
||||||
if (!peerConnection) {
|
if (!peerConnection) {
|
||||||
reject(peerConnection);
|
reject(peerConnection);
|
||||||
@@ -221,7 +226,7 @@ export class PeerManager {
|
|||||||
peer_id: this.peerID,
|
peer_id: this.peerID,
|
||||||
session_id: this.sessionID,
|
session_id: this.sessionID,
|
||||||
// peer_name: app.peername,
|
// peer_name: app.peername,
|
||||||
is_bootstrap_peer: this.isBootstrapPeer,
|
is_bootstrap_peer: this._isBootstrapPeer,
|
||||||
// peer_description: this.rtcPeerDescription
|
// peer_description: this.rtcPeerDescription
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -246,7 +251,7 @@ export class PeerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(userID: string, peerID: string, isBootstrapPeer: boolean) {
|
constructor(userID: string, peerID: string, isBootstrapPeer: boolean) {
|
||||||
this.isBootstrapPeer = isBootstrapPeer;
|
this._isBootstrapPeer = isBootstrapPeer;
|
||||||
this.peers = new Map();
|
this.peers = new Map();
|
||||||
this.routingTable = new Map();
|
this.routingTable = new Map();
|
||||||
this.userID = userID;
|
this.userID = userID;
|
||||||
@@ -324,7 +329,7 @@ export class PeerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!this.isBootstrapPeer && numActive === 0) {
|
if (!this._isBootstrapPeer && numActive === 0) {
|
||||||
console.log.apply(null, log(`No peers connected, will attempt to reconnect in ${this.reconnectPeriod} seconds...`));
|
console.log.apply(null, log(`No peers connected, will attempt to reconnect in ${this.reconnectPeriod} seconds...`));
|
||||||
|
|
||||||
// Websocket reconnect
|
// Websocket reconnect
|
||||||
@@ -342,6 +347,13 @@ export class PeerManager {
|
|||||||
let output = `Current status:` + "\n" + `[${logID(this.peerID)}]${this.getPeername(this.peerID)}[local]` + "\n";
|
let output = `Current status:` + "\n" + `[${logID(this.peerID)}]${this.getPeername(this.peerID)}[local]` + "\n";
|
||||||
for (let [peerID, peer] of this.peers) {
|
for (let [peerID, peer] of this.peers) {
|
||||||
output += `[${logID(peerID)}]${peer.rtcPeer?.connectionState}:${this.getPeername(peerID)}${this.bootstrapPeerIDs?.has(peerID) ? "[Bootstrap]" : ""}` + "\n";
|
output += `[${logID(peerID)}]${peer.rtcPeer?.connectionState}:${this.getPeername(peerID)}${this.bootstrapPeerIDs?.has(peerID) ? "[Bootstrap]" : ""}` + "\n";
|
||||||
|
|
||||||
|
if (peer.rpcSuperlog) {
|
||||||
|
for (let transactionID of peer.pendingRPCs.keys()) {
|
||||||
|
output += `[${logID(transactionID)}]`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output += `numActivePeers: ${numActive}` + "\n";
|
output += `numActivePeers: ${numActive}` + "\n";
|
||||||
@@ -588,7 +600,7 @@ class PeerConnection {
|
|||||||
|
|
||||||
// console.log.apply(null, log([...this.peerManager.peers.keys()]));
|
// console.log.apply(null, log([...this.peerManager.peers.keys()]));
|
||||||
|
|
||||||
if (this.peerManager.isBootstrapPeer) {
|
if (this.peerManager._isBootstrapPeer) {
|
||||||
this.send({ type: 'initial_peers', from: this.peerManager.peerID, peers: [...this.peerManager.peers.keys()].filter(entry => entry !== this.remotePeerID) });
|
this.send({ type: 'initial_peers', from: this.peerManager.peerID, peers: [...this.peerManager.peers.keys()].filter(entry => entry !== this.remotePeerID) });
|
||||||
// this.dataChannel.send(JSON.stringify());
|
// this.dataChannel.send(JSON.stringify());
|
||||||
}
|
}
|
||||||
@@ -616,6 +628,11 @@ class PeerConnection {
|
|||||||
|
|
||||||
async connect() {
|
async connect() {
|
||||||
let connectionPromise = new Promise((resolve, reject) => { this.connectionPromise = { resolve, reject } });
|
let connectionPromise = new Promise((resolve, reject) => { this.connectionPromise = { resolve, reject } });
|
||||||
|
|
||||||
|
if (!(typeof RTCPeerConnection === "function")) {
|
||||||
|
throw new Error("RTCPeerConnection is not a function, exiting.");
|
||||||
|
}
|
||||||
|
|
||||||
this.rtcPeer = new RTCPeerConnection(PeerConnection.config);
|
this.rtcPeer = new RTCPeerConnection(PeerConnection.config);
|
||||||
|
|
||||||
this.rtcPeer.onconnectionstatechange = async (e: any) => {
|
this.rtcPeer.onconnectionstatechange = async (e: any) => {
|
||||||
@@ -720,7 +737,11 @@ class PeerConnection {
|
|||||||
|
|
||||||
async onWebsocketMessage(message: any) {
|
async onWebsocketMessage(message: any) {
|
||||||
if (message.type == "rtc_connect") {
|
if (message.type == "rtc_connect") {
|
||||||
|
try {
|
||||||
this.rtcPeer?.setRemoteDescription(message.description);
|
this.rtcPeer?.setRemoteDescription(message.description);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -734,7 +755,7 @@ class PeerConnection {
|
|||||||
|
|
||||||
|
|
||||||
if (!this.rtcPeer) {
|
if (!this.rtcPeer) {
|
||||||
throw new Error();
|
throw new Error("Unable to instantiate RTCPeerConnection, exiting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
let description = null;
|
let description = null;
|
||||||
@@ -760,7 +781,12 @@ class PeerConnection {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.isSettingRemoteAnswerPending = description.type == "answer";
|
this.isSettingRemoteAnswerPending = description.type == "answer";
|
||||||
|
|
||||||
|
try {
|
||||||
await this.rtcPeer.setRemoteDescription(description);
|
await this.rtcPeer.setRemoteDescription(description);
|
||||||
|
} catch (e) {
|
||||||
|
console.log("PeerConnection:setRemoteDescription:failed:", e, description);
|
||||||
|
}
|
||||||
this.isSettingRemoteAnswerPending = false;
|
this.isSettingRemoteAnswerPending = false;
|
||||||
if (description.type === "offer") {
|
if (description.type === "offer") {
|
||||||
await this.rtcPeer.setLocalDescription();
|
await this.rtcPeer.setLocalDescription();
|
||||||
@@ -769,9 +795,11 @@ class PeerConnection {
|
|||||||
} else if (candidate) {
|
} else if (candidate) {
|
||||||
try {
|
try {
|
||||||
await this.rtcPeer.addIceCandidate(candidate);
|
await this.rtcPeer.addIceCandidate(candidate);
|
||||||
} catch (err) {
|
} catch (e) {
|
||||||
if (!this.ignoreOffer) {
|
if (!this.ignoreOffer) {
|
||||||
throw err;
|
console.log("PeerConnection:addIceCandidate:failed:", e, candidate);
|
||||||
|
throw e;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -869,7 +897,7 @@ class PeerConnection {
|
|||||||
// Think about a timeout here to auto reject it after a while.
|
// Think about a timeout here to auto reject it after a while.
|
||||||
let promise = new Promise((resolve, reject) => {
|
let promise = new Promise((resolve, reject) => {
|
||||||
this.pendingRPCs.set(transactionID, { resolve, reject, functionName });
|
this.pendingRPCs.set(transactionID, { resolve, reject, functionName });
|
||||||
// setTimeout(() => reject("bad"), 1000);
|
setTimeout(() => reject(`function:${functionName}[${transactionID}] failed to resolve after 10 seconds.`), 10_000);
|
||||||
});
|
});
|
||||||
|
|
||||||
let message = {
|
let message = {
|
||||||
@@ -909,6 +937,7 @@ class PeerConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pendingRPC.resolve(message.response);
|
pendingRPC.resolve(message.response);
|
||||||
|
this.pendingRPCs.delete(message.transaction_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === "rpc_call") {
|
if (type === "rpc_call") {
|
||||||
@@ -920,12 +949,6 @@ class PeerConnection {
|
|||||||
|
|
||||||
this.rpcSuperlog && console.log.apply(null, log(`[rpc] call: response:`, response));
|
this.rpcSuperlog && console.log.apply(null, log(`[rpc] call: response:`, response));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (response === undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let responseMessage = { type: 'rpc_response', function_name: message.function_name, transaction_id: message.transaction_id, response: response };
|
let responseMessage = { type: 'rpc_response', function_name: message.function_name, transaction_id: message.transaction_id, response: response };
|
||||||
this.send(responseMessage);
|
this.send(responseMessage);
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ export class Sync {
|
|||||||
following.push(...[
|
following.push(...[
|
||||||
'b38b623c-c3fa-4351-9cab-50233c99fa4e', // Rob
|
'b38b623c-c3fa-4351-9cab-50233c99fa4e', // Rob
|
||||||
'05a495a0-0dd8-4186-94c3-b8309ba6fc4c', // Martin
|
'05a495a0-0dd8-4186-94c3-b8309ba6fc4c', // Martin
|
||||||
|
'622ecc28-2eff-44b9-b89d-fdea7c8dd2d5', // Hazel
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,8 +199,8 @@ export class App {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let knownUsers = await this.sync.getKnownUsers();
|
let knownUsers = await this.sync.getKnownUsers();
|
||||||
this.peerManager.rpc.announceUsers(event.peerID, this.peerID, knownUsers);
|
|
||||||
// rpc saying what peers we have
|
// rpc saying what peers we have
|
||||||
|
this.peerManager.rpc.announceUsers(event.peerID, this.peerID, knownUsers);
|
||||||
});
|
});
|
||||||
this.peerManager.addEventListener(PeerEventTypes.PEER_DISCONNECTED, async (event) => {
|
this.peerManager.addEventListener(PeerEventTypes.PEER_DISCONNECTED, async (event) => {
|
||||||
console.log.apply(null, log(`[app]: peer disconnected:${event.peerID}`));
|
console.log.apply(null, log(`[app]: peer disconnected:${event.peerID}`));
|
||||||
@@ -1183,3 +1183,4 @@ export class App {
|
|||||||
})(Route = App.Route || (App.Route = {}));
|
})(Route = App.Route || (App.Route = {}));
|
||||||
})(App || (App = {}));
|
})(App || (App = {}));
|
||||||
;
|
;
|
||||||
|
//# sourceMappingURL=App.js.map
|
||||||
1
static/App.js.map
Normal file
1
static/App.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -7,3 +7,4 @@ export function generateID() {
|
|||||||
}
|
}
|
||||||
return uuidv4();
|
return uuidv4();
|
||||||
}
|
}
|
||||||
|
//# sourceMappingURL=IDUtils.js.map
|
||||||
1
static/IDUtils.js.map
Normal file
1
static/IDUtils.js.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"IDUtils.js","sourceRoot":"","sources":["../src/IDUtils.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM;IACX,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAM,EAAE,EAAE,CACvE,CAAC,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAChF,CAAC;AACN,CAAC;AAED,MAAM,UAAU,UAAU;IACtB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED,OAAO,MAAM,EAAE,CAAC;AACpB,CAAC"}
|
||||||
@@ -33,6 +33,9 @@ export class PeerManager {
|
|||||||
let peername = `${adjective}_${snake}`;
|
let peername = `${adjective}_${snake}`;
|
||||||
return peername;
|
return peername;
|
||||||
}
|
}
|
||||||
|
isBootstrapPeer(peerID) {
|
||||||
|
return this.bootstrapPeerIDs?.has(peerID);
|
||||||
|
}
|
||||||
websocketSend(message) {
|
websocketSend(message) {
|
||||||
if (!this.websocket) {
|
if (!this.websocket) {
|
||||||
throw new Error();
|
throw new Error();
|
||||||
@@ -60,7 +63,7 @@ export class PeerManager {
|
|||||||
}
|
}
|
||||||
this.messageSuperlog && console.log.apply(null, log("->signaler:", message));
|
this.messageSuperlog && console.log.apply(null, log("->signaler:", message));
|
||||||
if (message.type === "hello2") {
|
if (message.type === "hello2") {
|
||||||
if (!this.isBootstrapPeer && Array.isArray(message?.bootstrapPeers)) {
|
if (!this._isBootstrapPeer && Array.isArray(message?.bootstrapPeers)) {
|
||||||
this.bootstrapPeerIDs = new Set(message.bootstrapPeers);
|
this.bootstrapPeerIDs = new Set(message.bootstrapPeers);
|
||||||
}
|
}
|
||||||
this.onHello2Received(this.bootstrapPeerIDs);
|
this.onHello2Received(this.bootstrapPeerIDs);
|
||||||
@@ -79,7 +82,7 @@ export class PeerManager {
|
|||||||
if (!peerConnection) {
|
if (!peerConnection) {
|
||||||
let remotePeerID = message.from;
|
let remotePeerID = message.from;
|
||||||
let newPeer = new PeerConnection(this, remotePeerID, this.websocketSendPeerMessage.bind(this));
|
let newPeer = new PeerConnection(this, remotePeerID, this.websocketSendPeerMessage.bind(this));
|
||||||
if (this.isBootstrapPeer) {
|
if (this._isBootstrapPeer) {
|
||||||
newPeer.setPolite(false);
|
newPeer.setPolite(false);
|
||||||
}
|
}
|
||||||
peerConnection = newPeer;
|
peerConnection = newPeer;
|
||||||
@@ -105,7 +108,7 @@ export class PeerManager {
|
|||||||
return newPeer;
|
return newPeer;
|
||||||
}
|
}
|
||||||
async onHello2Received(bootstrapPeerIDs) {
|
async onHello2Received(bootstrapPeerIDs) {
|
||||||
if (this.isBootstrapPeer) {
|
if (this._isBootstrapPeer) {
|
||||||
this.connectPromiseCallbacks?.resolve();
|
this.connectPromiseCallbacks?.resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -139,7 +142,7 @@ export class PeerManager {
|
|||||||
peer_id: this.peerID,
|
peer_id: this.peerID,
|
||||||
session_id: this.sessionID,
|
session_id: this.sessionID,
|
||||||
// peer_name: app.peername,
|
// peer_name: app.peername,
|
||||||
is_bootstrap_peer: this.isBootstrapPeer,
|
is_bootstrap_peer: this._isBootstrapPeer,
|
||||||
// peer_description: this.rtcPeerDescription
|
// peer_description: this.rtcPeerDescription
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -164,7 +167,7 @@ export class PeerManager {
|
|||||||
this.searchQueryFunctions = new Map();
|
this.searchQueryFunctions = new Map();
|
||||||
this.RPC_remote = new Map();
|
this.RPC_remote = new Map();
|
||||||
this.rpc = {};
|
this.rpc = {};
|
||||||
this.isBootstrapPeer = false;
|
this._isBootstrapPeer = false;
|
||||||
this.bootstrapPeerConnections = null;
|
this.bootstrapPeerConnections = null;
|
||||||
this.sessionID = generateID();
|
this.sessionID = generateID();
|
||||||
this.websocket = null;
|
this.websocket = null;
|
||||||
@@ -188,7 +191,7 @@ export class PeerManager {
|
|||||||
this.animals = ['shrew', 'jerboa', 'lemur', 'weasel', 'possum', 'possum', 'marmoset', 'planigale', 'mole', 'narwhal'];
|
this.animals = ['shrew', 'jerboa', 'lemur', 'weasel', 'possum', 'possum', 'marmoset', 'planigale', 'mole', 'narwhal'];
|
||||||
this.adjectives = ['snazzy', 'whimsical', 'jazzy', 'bonkers', 'wobbly', 'spiffy', 'chirpy', 'zesty', 'bubbly', 'perky', 'sassy'];
|
this.adjectives = ['snazzy', 'whimsical', 'jazzy', 'bonkers', 'wobbly', 'spiffy', 'chirpy', 'zesty', 'bubbly', 'perky', 'sassy'];
|
||||||
this.snakes = ['mamba', 'cobra', 'python', 'viper', 'krait', 'sidewinder', 'constrictor', 'boa', 'asp', 'anaconda', 'krait'];
|
this.snakes = ['mamba', 'cobra', 'python', 'viper', 'krait', 'sidewinder', 'constrictor', 'boa', 'asp', 'anaconda', 'krait'];
|
||||||
this.isBootstrapPeer = isBootstrapPeer;
|
this._isBootstrapPeer = isBootstrapPeer;
|
||||||
this.peers = new Map();
|
this.peers = new Map();
|
||||||
this.routingTable = new Map();
|
this.routingTable = new Map();
|
||||||
this.userID = userID;
|
this.userID = userID;
|
||||||
@@ -244,7 +247,7 @@ export class PeerManager {
|
|||||||
}
|
}
|
||||||
numActive++;
|
numActive++;
|
||||||
}
|
}
|
||||||
if (!this.isBootstrapPeer && numActive === 0) {
|
if (!this._isBootstrapPeer && numActive === 0) {
|
||||||
console.log.apply(null, log(`No peers connected, will attempt to reconnect in ${this.reconnectPeriod} seconds...`));
|
console.log.apply(null, log(`No peers connected, will attempt to reconnect in ${this.reconnectPeriod} seconds...`));
|
||||||
// Websocket reconnect
|
// Websocket reconnect
|
||||||
if (this.websocket?.readyState === WebSocket.OPEN) {
|
if (this.websocket?.readyState === WebSocket.OPEN) {
|
||||||
@@ -257,6 +260,11 @@ export class PeerManager {
|
|||||||
let output = `Current status:` + "\n" + `[${logID(this.peerID)}]${this.getPeername(this.peerID)}[local]` + "\n";
|
let output = `Current status:` + "\n" + `[${logID(this.peerID)}]${this.getPeername(this.peerID)}[local]` + "\n";
|
||||||
for (let [peerID, peer] of this.peers) {
|
for (let [peerID, peer] of this.peers) {
|
||||||
output += `[${logID(peerID)}]${peer.rtcPeer?.connectionState}:${this.getPeername(peerID)}${this.bootstrapPeerIDs?.has(peerID) ? "[Bootstrap]" : ""}` + "\n";
|
output += `[${logID(peerID)}]${peer.rtcPeer?.connectionState}:${this.getPeername(peerID)}${this.bootstrapPeerIDs?.has(peerID) ? "[Bootstrap]" : ""}` + "\n";
|
||||||
|
if (peer.rpcSuperlog) {
|
||||||
|
for (let transactionID of peer.pendingRPCs.keys()) {
|
||||||
|
output += `[${logID(transactionID)}]`;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
output += `numActivePeers: ${numActive}` + "\n";
|
output += `numActivePeers: ${numActive}` + "\n";
|
||||||
console.log.apply(null, log(output));
|
console.log.apply(null, log(output));
|
||||||
@@ -421,7 +429,7 @@ class PeerConnection {
|
|||||||
this.send({ type: "hello datachannel", from: this.peerManager.peerID, to: this.remotePeerID });
|
this.send({ type: "hello datachannel", from: this.peerManager.peerID, to: this.remotePeerID });
|
||||||
// this.dataChannel?.send(`{typeHello datachannel from: ${this.peerManager.peerID}`);
|
// this.dataChannel?.send(`{typeHello datachannel from: ${this.peerManager.peerID}`);
|
||||||
// console.log.apply(null, log([...this.peerManager.peers.keys()]));
|
// console.log.apply(null, log([...this.peerManager.peers.keys()]));
|
||||||
if (this.peerManager.isBootstrapPeer) {
|
if (this.peerManager._isBootstrapPeer) {
|
||||||
this.send({ type: 'initial_peers', from: this.peerManager.peerID, peers: [...this.peerManager.peers.keys()].filter(entry => entry !== this.remotePeerID) });
|
this.send({ type: 'initial_peers', from: this.peerManager.peerID, peers: [...this.peerManager.peers.keys()].filter(entry => entry !== this.remotePeerID) });
|
||||||
// this.dataChannel.send(JSON.stringify());
|
// this.dataChannel.send(JSON.stringify());
|
||||||
}
|
}
|
||||||
@@ -442,6 +450,9 @@ class PeerConnection {
|
|||||||
}
|
}
|
||||||
async connect() {
|
async connect() {
|
||||||
let connectionPromise = new Promise((resolve, reject) => { this.connectionPromise = { resolve, reject }; });
|
let connectionPromise = new Promise((resolve, reject) => { this.connectionPromise = { resolve, reject }; });
|
||||||
|
if (!(typeof RTCPeerConnection === "function")) {
|
||||||
|
throw new Error("RTCPeerConnection is not a function, exiting.");
|
||||||
|
}
|
||||||
this.rtcPeer = new RTCPeerConnection(PeerConnection.config);
|
this.rtcPeer = new RTCPeerConnection(PeerConnection.config);
|
||||||
this.rtcPeer.onconnectionstatechange = async (e) => {
|
this.rtcPeer.onconnectionstatechange = async (e) => {
|
||||||
this.webRTCSuperlog && console.log.apply(null, log(`rtcPeer: onconnectionstatechange: ${this.rtcPeer?.connectionState}: ${this.remotePeerID}`));
|
this.webRTCSuperlog && console.log.apply(null, log(`rtcPeer: onconnectionstatechange: ${this.rtcPeer?.connectionState}: ${this.remotePeerID}`));
|
||||||
@@ -519,14 +530,19 @@ class PeerConnection {
|
|||||||
}
|
}
|
||||||
async onWebsocketMessage(message) {
|
async onWebsocketMessage(message) {
|
||||||
if (message.type == "rtc_connect") {
|
if (message.type == "rtc_connect") {
|
||||||
|
try {
|
||||||
this.rtcPeer?.setRemoteDescription(message.description);
|
this.rtcPeer?.setRemoteDescription(message.description);
|
||||||
}
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
// /*
|
// /*
|
||||||
// let ignoreOffer = false;
|
// let ignoreOffer = false;
|
||||||
// let isSettingRemoteAnswerPending = false;
|
// let isSettingRemoteAnswerPending = false;
|
||||||
// signaler.onmessage = async ({ data: { description, candidate } }) => {
|
// signaler.onmessage = async ({ data: { description, candidate } }) => {
|
||||||
if (!this.rtcPeer) {
|
if (!this.rtcPeer) {
|
||||||
throw new Error();
|
throw new Error("Unable to instantiate RTCPeerConnection, exiting.");
|
||||||
}
|
}
|
||||||
let description = null;
|
let description = null;
|
||||||
if (message.type == "rtc_description") {
|
if (message.type == "rtc_description") {
|
||||||
@@ -547,7 +563,12 @@ class PeerConnection {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.isSettingRemoteAnswerPending = description.type == "answer";
|
this.isSettingRemoteAnswerPending = description.type == "answer";
|
||||||
|
try {
|
||||||
await this.rtcPeer.setRemoteDescription(description);
|
await this.rtcPeer.setRemoteDescription(description);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log("PeerConnection:setRemoteDescription:failed:", e, description);
|
||||||
|
}
|
||||||
this.isSettingRemoteAnswerPending = false;
|
this.isSettingRemoteAnswerPending = false;
|
||||||
if (description.type === "offer") {
|
if (description.type === "offer") {
|
||||||
await this.rtcPeer.setLocalDescription();
|
await this.rtcPeer.setLocalDescription();
|
||||||
@@ -558,9 +579,10 @@ class PeerConnection {
|
|||||||
try {
|
try {
|
||||||
await this.rtcPeer.addIceCandidate(candidate);
|
await this.rtcPeer.addIceCandidate(candidate);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (e) {
|
||||||
if (!this.ignoreOffer) {
|
if (!this.ignoreOffer) {
|
||||||
throw err;
|
console.log("PeerConnection:addIceCandidate:failed:", e, candidate);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -632,7 +654,7 @@ class PeerConnection {
|
|||||||
// Think about a timeout here to auto reject it after a while.
|
// Think about a timeout here to auto reject it after a while.
|
||||||
let promise = new Promise((resolve, reject) => {
|
let promise = new Promise((resolve, reject) => {
|
||||||
this.pendingRPCs.set(transactionID, { resolve, reject, functionName });
|
this.pendingRPCs.set(transactionID, { resolve, reject, functionName });
|
||||||
// setTimeout(() => reject("bad"), 1000);
|
setTimeout(() => reject(`function:${functionName}[${transactionID}] failed to resolve after 10 seconds.`), 10000);
|
||||||
});
|
});
|
||||||
let message = {
|
let message = {
|
||||||
type: "rpc_call",
|
type: "rpc_call",
|
||||||
@@ -661,14 +683,12 @@ class PeerConnection {
|
|||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
pendingRPC.resolve(message.response);
|
pendingRPC.resolve(message.response);
|
||||||
|
this.pendingRPCs.delete(message.transaction_id);
|
||||||
}
|
}
|
||||||
if (type === "rpc_call") {
|
if (type === "rpc_call") {
|
||||||
this.rpcSuperlog && console.log.apply(null, log(`[${logID(this.remotePeerID)}]->[rpc][${logID(this.peerManager.peerID)}] call: `, message.function_name, message.transaction_id, JSON.stringify(message.args, null, 2)));
|
this.rpcSuperlog && console.log.apply(null, log(`[${logID(this.remotePeerID)}]->[rpc][${logID(this.peerManager.peerID)}] call: `, message.function_name, message.transaction_id, JSON.stringify(message.args, null, 2)));
|
||||||
let response = await this.peerManager.callFromRemote(message.function_name, message.args);
|
let response = await this.peerManager.callFromRemote(message.function_name, message.args);
|
||||||
this.rpcSuperlog && console.log.apply(null, log(`[rpc] call: response:`, response));
|
this.rpcSuperlog && console.log.apply(null, log(`[rpc] call: response:`, response));
|
||||||
if (response === undefined) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let responseMessage = { type: 'rpc_response', function_name: message.function_name, transaction_id: message.transaction_id, response: response };
|
let responseMessage = { type: 'rpc_response', function_name: message.function_name, transaction_id: message.transaction_id, response: response };
|
||||||
this.send(responseMessage);
|
this.send(responseMessage);
|
||||||
}
|
}
|
||||||
@@ -715,3 +735,4 @@ PeerConnection.config = {
|
|||||||
{ urls: "stun:stun4.l.google.com" },
|
{ urls: "stun:stun4.l.google.com" },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
//# sourceMappingURL=PeerManager.js.map
|
||||||
1
static/PeerManager.js.map
Normal file
1
static/PeerManager.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -144,6 +144,7 @@ export class Sync {
|
|||||||
following.push(...[
|
following.push(...[
|
||||||
'b38b623c-c3fa-4351-9cab-50233c99fa4e', // Rob
|
'b38b623c-c3fa-4351-9cab-50233c99fa4e', // Rob
|
||||||
'05a495a0-0dd8-4186-94c3-b8309ba6fc4c', // Martin
|
'05a495a0-0dd8-4186-94c3-b8309ba6fc4c', // Martin
|
||||||
|
'622ecc28-2eff-44b9-b89d-fdea7c8dd2d5', // Hazel
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return following;
|
return following;
|
||||||
@@ -224,3 +225,4 @@ export class Sync {
|
|||||||
await mergeDataArray(userID, [post]);
|
await mergeDataArray(userID, [post]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//# sourceMappingURL=Sync.js.map
|
||||||
1
static/Sync.js.map
Normal file
1
static/Sync.js.map
Normal file
File diff suppressed because one or more lines are too long
@@ -69,3 +69,4 @@ export async function compressString(input) {
|
|||||||
// const bytes = uuidToBytes(uuid);
|
// const bytes = uuidToBytes(uuid);
|
||||||
// return encodeBase58(bytes);
|
// return encodeBase58(bytes);
|
||||||
// }
|
// }
|
||||||
|
//# sourceMappingURL=dataUtils.js.map
|
||||||
1
static/dataUtils.js.map
Normal file
1
static/dataUtils.js.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"dataUtils.js","sourceRoot":"","sources":["../src/dataUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,KAAiB,EAAE,IAAI,GAAG,0BAA0B;IAC7F,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,EAAE,EAAE;YAC7C,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;YACpC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;SACpC,CAAC,CAAC;QACH,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAmB;IAC3D,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,MAAM,oBAAoB,CAAC,KAAK,CAAY,CAAA,CAAC,OAAO,CAAC,uCAAuC,EAAE,EAAE,CAAC,CAAC;AAC5G,CAAC;AAED,6DAA6D;AAC7D,wFAAwF;AACxF,oDAAoD;AACpD,wBAAwB;AACxB,IAAI;AAEJ,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAa;IAChD,qCAAqC;IACrC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE7C,6BAA6B;IAC7B,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAEtD,sCAAsC;IACtC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,MAAM,CAAC,KAAK,EAAE,CAAC;IAEf,2CAA2C;IAC3C,MAAM,eAAe,GAAG,MAAM,IAAI,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAErF,8CAA8C;IAC9C,OAAO,IAAI,UAAU,CAAC,eAAe,CAAC,CAAC;AACzC,CAAC;AAED,uBAAuB;AACvB,wFAAwF;AACxF,kBAAkB;AAClB,kBAAkB;AAClB,sDAAsD;AACtD,eAAe;AACf,wBAAwB;AAExB,iCAAiC;AACjC,oBAAoB;AACpB,gDAAgD;AAChD,iCAAiC;AACjC,gCAAgC;AAChC,wCAAwC;AACxC,QAAQ;AACR,0BAA0B;AAC1B,iCAAiC;AACjC,wCAAwC;AACxC,QAAQ;AACR,MAAM;AAEN,qBAAqB;AACrB,4CAA4C;AAC5C,wCAAwC;AACxC,MAAM;AAEN,iCAAiC;AACjC,iCAAiC;AACjC,2BAA2B;AAC3B,8CAA8C;AAC9C,eAAe;AACf,eAAe;AACf,QAAQ;AACR,MAAM;AAEN,mBAAmB;AACnB,IAAI;AAEJ,4BAA4B;AAC5B,gDAAgD;AAChD,qCAAqC;AACrC,gCAAgC;AAChC,IAAI"}
|
||||||
@@ -345,3 +345,4 @@ export async function getPostsByIds(userID, postIDs) {
|
|||||||
}
|
}
|
||||||
return posts; // Return the array of posts
|
return posts; // Return the array of posts
|
||||||
}
|
}
|
||||||
|
//# sourceMappingURL=db.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -37,3 +37,4 @@ export function log(...args) {
|
|||||||
renderLog();
|
renderLog();
|
||||||
return [logLine]; // [...args];
|
return [logLine]; // [...args];
|
||||||
}
|
}
|
||||||
|
//# sourceMappingURL=log.js.map
|
||||||
1
static/log.js.map
Normal file
1
static/log.js.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,IAAI,QAAQ,GAAa,EAAE,CAAC;AAC5B,IAAI,SAAS,GAAG,GAAG,CAAC;AACpB,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC5C,UAAU,GAAG,OAAO,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,IAAI,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,EAAE,CAAC;IACpB,CAAC;IACD,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,GAAG,IAAW;IAChC,wBAAwB;IAExB,IAAI,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,KAAK,CAAC;IACvD,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,YAAY,GAAG,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3G,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,YAAY,GAAG,WAAW,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IAE9B,IAAI,QAAQ,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAChC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,EAAE,CAAC;IAEZ,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA,aAAa;AAChC,CAAC"}
|
||||||
@@ -1577,3 +1577,4 @@ class App {
|
|||||||
})(App || (App = {}));
|
})(App || (App = {}));
|
||||||
let app = new App();
|
let app = new App();
|
||||||
window.addEventListener("load", app.main.bind(app));
|
window.addEventListener("load", app.main.bind(app));
|
||||||
|
//# sourceMappingURL=main.js.map
|
||||||
@@ -39,3 +39,4 @@ window.addEventListener('scroll', () => {
|
|||||||
});
|
});
|
||||||
let app = new App();
|
let app = new App();
|
||||||
window.addEventListener("load", app.main.bind(app));
|
window.addEventListener("load", app.main.bind(app));
|
||||||
|
//# sourceMappingURL=main2.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -121,3 +121,4 @@ addEventListener("message", async (e) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//# sourceMappingURL=sw.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"sw.js","sourceRoot":"","sources":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,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,KAAU;IACjD,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,uCAAuC;AACzC,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACtC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3D,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,YAAY;YACf,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3C,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACpE,yCAAyC;YAEzC,KAAK,IAAI,IAAI,IAAI,cAAc,EAAE,CAAC;gBAChC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;YAED,MAAM,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YACnC,MAAM;IACV,CAAC;AACH,CAAC,CAAC,CAAC"}
|
||||||
1
static/tests.js.map
Normal file
1
static/tests.js.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAGlD,oBAAoB;AACpB,6BAA6B;AAC7B,4BAA4B;AAE5B,yCAAyC;AACzC,gFAAgF;AAChF,0CAA0C;AAE1C,6DAA6D;AAC7D,QAAQ;AACR,IAAI"}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
|
||||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||||
"sourceMap": false, /* Generates corresponding '.map' file. */
|
"sourceMap": true, /* Generates corresponding '.map' file. */
|
||||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||||
"outDir": "./static", /* Redirect output structure to the directory. */
|
"outDir": "./static", /* Redirect output structure to the directory. */
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
|
|||||||
83
webRTC.js
83
webRTC.js
@@ -1,83 +0,0 @@
|
|||||||
// https://web.dev/articles/webrtc-basics
|
|
||||||
|
|
||||||
// handles JSON.stringify/parse
|
|
||||||
|
|
||||||
class SignalingChannel {
|
|
||||||
send(message) {
|
|
||||||
console.log(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function createPeerConnection(targetPeer) {
|
|
||||||
|
|
||||||
const signaling = new SignalingChannel();
|
|
||||||
|
|
||||||
// const constraints = {audio: true, video: true};
|
|
||||||
const configuration = { iceServers: [{ urls: 'stun:stunserver2024.stunprotocol.org' }] };
|
|
||||||
const peerConnection = new RTCPeerConnection(configuration);
|
|
||||||
const sendChannel = peerConnection.createDataChannel('default');
|
|
||||||
|
|
||||||
|
|
||||||
// Send any ice candidates to the other peer.
|
|
||||||
peerConnection.onicecandidate = ({ candidate }) => signaling.send({ candidate });
|
|
||||||
|
|
||||||
// Let the "negotiationneeded" event trigger offer generation.
|
|
||||||
peerConnection.onnegotiationneeded = async () => {
|
|
||||||
try {
|
|
||||||
await peerConnection.setLocalDescription(await peerConnection.createOffer());
|
|
||||||
// Send the offer to the other peer.
|
|
||||||
signaling.send({ desc: peerConnection.localDescription });
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// // Once remote track media arrives, show it in remote video element.
|
|
||||||
// peerConnection.ontrack = (event) => {
|
|
||||||
// // Don't set srcObject again if it is already set.
|
|
||||||
// if (remoteView.srcObject) return;
|
|
||||||
// remoteView.srcObject = event.streams[0];
|
|
||||||
// };
|
|
||||||
|
|
||||||
// Call start() to initiate.
|
|
||||||
async function start() {
|
|
||||||
// try {
|
|
||||||
// Get local stream, show it in self-view, and add it to be sent.
|
|
||||||
// const stream =
|
|
||||||
// await navigator.mediaDevices.getUserMedia(constraints);
|
|
||||||
// stream.getTracks().forEach((track) =>
|
|
||||||
// peerConnection.addTrack(track, stream));
|
|
||||||
// selfView.srcObject = stream;
|
|
||||||
// } catch (err) {
|
|
||||||
// console.error(err);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
signaling.onmessage = async ({ desc, candidate }) => {
|
|
||||||
try {
|
|
||||||
if (desc) {
|
|
||||||
// If you get an offer, you need to reply with an answer.
|
|
||||||
if (desc.type === 'offer') {
|
|
||||||
await peerConnection.setRemoteDescription(desc);
|
|
||||||
// const stream =
|
|
||||||
// await navigator.mediaDevices.getUserMedia(constraints);
|
|
||||||
// stream.getTracks().forEach((track) =>
|
|
||||||
// peerConnection.addTrack(track, stream));
|
|
||||||
await peerConnection.setLocalDescription(await peerConnection.createAnswer());
|
|
||||||
signaling.send({ desc: peerConnection.localDescription });
|
|
||||||
} else if (desc.type === 'answer') {
|
|
||||||
await peerConnection.setRemoteDescription(desc);
|
|
||||||
} else {
|
|
||||||
console.log('Unsupported SDP type.');
|
|
||||||
}
|
|
||||||
} else if (candidate) {
|
|
||||||
await peerConnection.addIceCandidate(candidate);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"webRTC.js","sourceRoot":"","sources":["src/webRTC.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW;IACf,OAAO,CAAC,MAAa;QACnB,kDAAkD;IACpD,CAAC;IAED,UAAU,CAAC,MAAa;IACxB,CAAC;CACF;AAID,MAAM,cAAc;;AACX,qBAAM,GAAG;IACd,UAAU,EAAE;QACV,EAAE,IAAI,EAAE,wBAAwB,EAAE;QAClC,EAAE,IAAI,EAAE,yBAAyB,EAAE;QACnC,EAAE,IAAI,EAAE,yBAAyB,EAAE;QACnC,EAAE,IAAI,EAAE,yBAAyB,EAAE;QACnC,EAAE,IAAI,EAAE,yBAAyB,EAAE;KACpC;CAAE,CAAC;AAOR,MAAM,MAAM,GAAG;IACb,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC;CACrD,CAAC;AAEF,IAAI,MAAM,GAAG,IAAI,CAAC;AAElB,2CAA2C;AAC3C,MAAM,QAAQ,GAAO,EAAE,CAAA;AACvB,MAAM,EAAE,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAGzC,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAC3D,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAE/D,KAAK,UAAU,KAAK;IAClB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAEtE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvC,EAAE,CAAC,QAAQ,CAAC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