mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 22:10: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]]
|
[[package]]
|
||||||
name = "epoxy-client"
|
name = "epoxy-client"
|
||||||
version = "2.1.0"
|
version = "2.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-compression",
|
"async-compression",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "epoxy-client"
|
name = "epoxy-client"
|
||||||
version = "2.1.0"
|
version = "2.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[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 () => {
|
(async () => {
|
||||||
const params = (new URL(location.href)).searchParams;
|
const params = (new URL(location.href)).searchParams;
|
||||||
|
@ -40,6 +40,7 @@ import initEpoxy, { EpoxyClient, EpoxyClientOptions, EpoxyHandlers } from "./pkg
|
||||||
console.log(epoxy_client);
|
console.log(epoxy_client);
|
||||||
// you can change the user agent and redirect limit in JS
|
// you can change the user agent and redirect limit in JS
|
||||||
epoxy_client.redirect_limit = 15;
|
epoxy_client.redirect_limit = 15;
|
||||||
|
console.log(epoxyInfo());
|
||||||
|
|
||||||
const test_mux = async (url) => {
|
const test_mux = async (url) => {
|
||||||
const t0 = performance.now();
|
const t0 = performance.now();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mercuryworkshop/epoxy-tls",
|
"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",
|
"description": "A wasm library for using raw encrypted tls/ssl/tcp/udp/https/websocket streams on the browser",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "./build.sh"
|
"build": "./build.sh"
|
||||||
|
|
|
@ -43,6 +43,20 @@ mod utils;
|
||||||
mod websocket;
|
mod websocket;
|
||||||
mod ws_wrapper;
|
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>;
|
type HttpBody = http_body_util::Full<Bytes>;
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue