Working ws

This commit is contained in:
2026-08-16 06:50:24 +02:00
parent 350ced81e6
commit d48cb52669
2 changed files with 37 additions and 10 deletions
+18 -1
View File
@@ -1,12 +1,29 @@
import { useState } from "react";
import { useEffect, useState } from "react";
import reactLogo from "./assets/react.svg";
import { invoke } from "@tauri-apps/api/core";
import "./App.css";
import { EnclaveWebSocket } from "./protocol/ws";
function App() {
const [greetMsg, setGreetMsg] = useState("");
const [name, setName] = useState("");
useEffect(() => {
(async () => {
const ws = new EnclaveWebSocket("ws://localhost:3415");
ws.send({
method: "Initialize",
public_key: "",
signature: "",
timestamp: 0,
hostname: "",
});
// console.log(await ws.read());
})();
}, []);
async function greet() {
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
setGreetMsg(await invoke("greet", { name }));