@mercuryworkshop/epoxy-tls
Advanced tools
Comparing version 1.3.0 to 1.4.0
15
demo.js
@@ -174,3 +174,3 @@ import epoxy from "./pkg/epoxy-module-bundled.js"; | ||
log("sending `data`"); | ||
await ws.send("data"); | ||
await ws.send_text("data"); | ||
await (new Promise((res, _) => setTimeout(res, 50))); | ||
@@ -185,5 +185,5 @@ } | ||
msg => { console.log(msg); log(decoder.decode(msg)) }, | ||
"alicesworld.tech:443", | ||
"google.com:443", | ||
); | ||
await ws.send("GET / HTTP 1.1\r\nHost: alicesworld.tech\r\nConnection: close\r\n\r\n"); | ||
await ws.send((new TextEncoder()).encode("GET / HTTP 1.1\r\nHost: google.com\r\nConnection: close\r\n\r\n")); | ||
await (new Promise((res, _) => setTimeout(res, 500))); | ||
@@ -193,3 +193,3 @@ await ws.close(); | ||
let decoder = new TextDecoder(); | ||
// nc -ulp 5000 | ||
// tokio example: `cargo r --example echo-udp -- 127.0.0.1:5000` | ||
let ws = await epoxy_client.connect_udp( | ||
@@ -202,4 +202,7 @@ () => log("opened"), | ||
); | ||
await (new Promise((res, _) => setTimeout(res, 5000))); | ||
await ws.close(); | ||
while (true) { | ||
log("sending `data`"); | ||
await ws.send((new TextEncoder()).encode("data")); | ||
await (new Promise((res, _) => setTimeout(res, 50))); | ||
} | ||
} else if (should_reconnect_test) { | ||
@@ -206,0 +209,0 @@ while (true) { |
{ | ||
"name": "@mercuryworkshop/epoxy-tls", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "A wasm library for using raw encrypted tls/ssl/https/websocket streams on the browser", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -178,6 +178,11 @@ declare namespace wasm_bindgen { | ||
*/ | ||
send(payload: string): Promise<void>; | ||
send_text(payload: string): Promise<void>; | ||
/** | ||
* @param {Uint8Array} payload | ||
* @returns {Promise<void>} | ||
*/ | ||
send_binary(payload: Uint8Array): Promise<void>; | ||
/** | ||
* @returns {Promise<void>} | ||
*/ | ||
close(): Promise<void>; | ||
@@ -184,0 +189,0 @@ /** |
@@ -178,6 +178,11 @@ declare namespace wasm_bindgen { | ||
*/ | ||
send(payload: string): Promise<void>; | ||
send_text(payload: string): Promise<void>; | ||
/** | ||
* @param {Uint8Array} payload | ||
* @returns {Promise<void>} | ||
*/ | ||
send_binary(payload: Uint8Array): Promise<void>; | ||
/** | ||
* @returns {Promise<void>} | ||
*/ | ||
close(): Promise<void>; | ||
@@ -184,0 +189,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3432029
16295