update to use newer client (this is still very broken)

This commit is contained in:
2026-04-09 10:59:44 -05:00
parent 3cff324d9d
commit dd88667d73
5 changed files with 45 additions and 23 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+8
View File
@@ -0,0 +1,8 @@
import { TetherClient } from "tether-ts";
const client = new TetherClient();
client.connect("ws://localhost:8080/tether");
client.subscribe("messages", (message) => {
console.log("Received message", message);
});
+21
View File
@@ -0,0 +1,21 @@
{
"name": "tether-example",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "tether-example",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"tether-ts": "github:wisplite/tether-ts"
}
},
"node_modules/tether-ts": {
"version": "1.0.3",
"resolved": "git+ssh://git@github.com/wisplite/tether-ts.git#00eeff128298d5d79d76c22ba609f83c09f5817f",
"license": "ISC"
}
}
}
+15
View File
@@ -0,0 +1,15 @@
{
"name": "tether-example",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"type": "module",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"tether-ts": "github:wisplite/tether-ts"
}
}
-23
View File
@@ -1,23 +0,0 @@
function test() {
const ws = new WebSocket("ws://localhost:8080/tether");
ws.onmessage = (event) => {
console.log(event.data);
};
ws.onopen = () => {
console.log("Connected to server");
ws.send(JSON.stringify({
type: "subscribe",
channel: "messages",
}));
setTimeout(() => {
ws.send(JSON.stringify({
type: "unsubscribe",
channel: "messages",
}));
}, 5000);
};
ws.onclose = () => {
console.log("Disconnected from server");
};
}
test();