Skip to content

Commit

Permalink
chore: Change domain to mitm.plus
Browse files Browse the repository at this point in the history
Signed-off-by: zu1k <i@lgf.im>
  • Loading branch information
zu1k committed Nov 20, 2021
1 parent 3cbe068 commit 354d733
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ codegen-units = 1

[dependencies]
bytes = { version = "1", features = ["serde"] }
clap = "2.33.3"
clap = "2.33"
env_logger = "0.9"
fancy-regex = "0.7"
http_mitm = { path = "http_mitm" }
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
[![GitHub issues](https://img.shields.io/github/issues/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/issues)
[![Build](https://github.com/zu1k/good-mitm/actions/workflows/build.yml/badge.svg)](https://github.com/zu1k/good-mitm/actions/workflows/build.yml)
[![GitHub license](https://img.shields.io/github/license/zu1k/good-mitm)](https://github.com/zu1k/good-mitm/blob/master/LICENSE)
[![Docs](https://img.shields.io/badge/docs-read-blue.svg?style=flat)](https://good-mitm.lgf.im)
[![Docs](https://img.shields.io/badge/docs-read-blue.svg?style=flat)](https://docs.mitm.plus)

利用`MITM`技术实现请求和返回的`重写``重定向``阻断`等操作

## 使用方法

这里仅介绍最基本的使用流程,具体使用方法和规则请查看[文档](https://good-mitm.lgf.im)
这里仅介绍最基本的使用流程,具体使用方法和规则请查看[文档](https://docs.mitm.plus)

### 证书准备

Expand Down
2 changes: 1 addition & 1 deletion docs/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
good-mitm.lgf.im
docs.mitm.plus
2 changes: 1 addition & 1 deletion http_mitm/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where
};

if let Some(host) = req.headers().get(http::header::HOST) {
if host.to_str().unwrap_or_default() == "good-mitm.com"
if host.to_str().unwrap_or_default() == "cert.mitm.plus"
&& req.method() == http::method::Method::GET
{
return Ok(Response::builder()
Expand Down
48 changes: 48 additions & 0 deletions src/deno/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
use deno_core::op_sync;
use deno_core::JsRuntime;

pub fn test_deno() {
// Initialize a runtime instance
let mut runtime = JsRuntime::new(Default::default());

// Register an op for summing a number array.
runtime.register_op(
"op_sum",
// The op-layer automatically deserializes inputs
// and serializes the returned Result & value
op_sync(|_state, nums: Vec<f64>, _: ()| {
// Sum inputs
let sum = nums.iter().fold(0.0, |a, v| a + v);
// return as a Result<f64, AnyError>
Ok(sum)
}),
);
runtime.sync_ops_cache();

// Now we see how to invoke the op we just defined. The runtime automatically
// contains a Deno.core object with several functions for interacting with it.
// You can find its definition in core.js.
runtime
.execute_script(
"<usage>",
r#"
// Print helper function, calling Deno.core.print()
function print(value) {
Deno.core.print(value.toString()+"\n");
}
const arr = [1, 2, 3];
print("The sum of");
print(arr);
print("is");
print(Deno.core.opSync('op_sum', arr));
// And incorrect usage
try {
print(Deno.core.opSync('op_sum', 0));
} catch(e) {
print('Exception:');
print(e);
}
"#,
)
.unwrap();
}

0 comments on commit 354d733

Please sign in to comment.