mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
add epoxy info function
This commit is contained in:
parent
569789c2a0
commit
72d43508d0
5 changed files with 19 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -513,7 +513,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "epoxy-client"
|
||||
version = "2.1.0"
|
||||
version = "2.1.1"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"async-trait",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "epoxy-client"
|
||||
version = "2.1.0"
|
||||
version = "2.1.1"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import initEpoxy, { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } from "./pkg/epoxy-bundled.js";
|
||||
import initEpoxy, { EpoxyClient, EpoxyClientOptions, EpoxyHandlers, info as epoxyInfo } from "./pkg/epoxy-bundled.js";
|
||||
|
||||
(async () => {
|
||||
const params = (new URL(location.href)).searchParams;
|
||||
|
@ -40,6 +40,7 @@ import initEpoxy, { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } from "./pkg
|
|||
console.log(epoxy_client);
|
||||
// you can change the user agent and redirect limit in JS
|
||||
epoxy_client.redirect_limit = 15;
|
||||
console.log(epoxyInfo());
|
||||
|
||||
const test_mux = async (url) => {
|
||||
const t0 = performance.now();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mercuryworkshop/epoxy-tls",
|
||||
"version": "2.1.0-1",
|
||||
"version": "2.1.1-1",
|
||||
"description": "A wasm library for using raw encrypted tls/ssl/tcp/udp/https/websocket streams on the browser",
|
||||
"scripts": {
|
||||
"build": "./build.sh"
|
||||
|
|
|
@ -43,6 +43,20 @@ mod utils;
|
|||
mod websocket;
|
||||
mod ws_wrapper;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn info() -> Object {
|
||||
let obj = Object::new();
|
||||
object_set(&obj, "version", env!("CARGO_PKG_VERSION").into());
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "full")] {
|
||||
object_set(&obj, "minimal", false.into());
|
||||
} else {
|
||||
object_set(&obj, "minimal", true.into());
|
||||
}
|
||||
};
|
||||
obj
|
||||
}
|
||||
|
||||
type HttpBody = http_body_util::Full<Bytes>;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue