const rust = import('./pkg'); const token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiYXNlX3VybCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NDA4MCIsImNvbXBhbnkiOiJUdXJuZXIiLCJkb21haW5fbmFtZSI6Imh0dHA6Ly8xMjcuMC4wLjEiLCJleHAiOjE1OTQwMTQ0NTUsImZlYXR1cmVzIjpbIm1hc3Rlcl93ZWJfcGxheWVyIl0sIm5iZiI6MTU5MzQwOTY1NSwiYXVkIjoiTWVkaWEtSU8gTWFzdGVyV2ViUGxheWVyIiwiaXNzIjoiTWVkaWEtSU8gU3VwcG9ydCBQbGF0Zm9ybSJ9.kS7ByzGQpl7hpT3mtqpjUS-Q2eBDoryqMaTP1HlYS_I"; const product = "master_web_player"; const signer_url = "http://localhost:8001"; rust .then(rust_module => { rust_module.web_validate(token, product, signer_url) .then(websocket => { const r = websocket.send(JSON.stringify({ "action": "start_play", "format": "IMF" })); }) .catch(error => { console.log("ERROR:", error); }) }) .catch(console.error);