Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring mock_server back #81

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ members =["client", "client_ios", "client_wasm"]
resolver="2"

[package]
name="webprover"
edition = "2021"
name ="webprover"
edition="2021"

# TODO: merge tlsnotary and origo into one `notary` bin
# TODO: put rust websocket proxy code into tlsnotary and origo
Expand All @@ -25,5 +25,12 @@ path="bin/mock_server.rs"
# [[test]]

[dependencies]
notary-server={ git="https://github.com/tlsnotary/tlsn.git " }
tokio ={ version="1" }
notary-server ={ git="https://github.com/tlsnotary/tlsn.git " }
tokio ={ version="1" }
hyper ={ version="1.1", features=["client", "http1"] }
hyper-util ={ version="0.1" }
http-body-util="0.1"
pki-types ={ package="rustls-pki-types", version="1.7" }
rustls ={ version="0.23.10" }
rustls-pemfile={ version="2.0.0" }
tokio-rustls ={ version="0.26.0" }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ make wasm
make ios # TODO
cargo run --release --bin tlsnotary
cargo run --release --bin origo # TODO
cargo run --release --bin mock_server # TODO
cargo run --release --bin mock_server
```

## WASM Demo

```
cargo run --release --bin tlsnotary
cargo run --release --bin mock_server # TODO port 8085
cargo run --release --bin mock_server
cargo run --release --bin websocket_proxy # TODO port 8050
make wasm
make wasm-demo
Expand Down
6 changes: 3 additions & 3 deletions bin/mock_target.rs.backup → bin/mock_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use tokio_rustls::TlsAcceptor;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let addr = "127.0.0.1:8080";
let addr = "0.0.0.0:8085";

let certs = load_certs("fixture/mock_server/server-cert.pem")?;
let key = load_private_key("fixture/mock_server/server-key.pem")?;
let certs = load_certs("./fixture/certs/server-cert.pem")?;
let key = load_private_key("./fixture/certs/server-key.pem")?;

let listener = TcpListener::bind(addr).await?;

Expand Down
Loading