Skip to content

Commit

Permalink
Merge pull request #4115 from wasmerio/browser-cfg-with-tun-tap
Browse files Browse the repository at this point in the history
Browser cfg, smaller WASM, VPN and HTTPS redirect
  • Loading branch information
john-sharratt authored Aug 10, 2023
2 parents 1725bab + 7941653 commit ff0680d
Show file tree
Hide file tree
Showing 48 changed files with 5,383 additions and 394 deletions.
383 changes: 298 additions & 85 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ impl Args {
Some(Cmd::Init(init)) => init.execute(),
Some(Cmd::Login(login)) => login.execute(),
Some(Cmd::Publish(publish)) => publish.execute(),
/*
Some(Cmd::Connect(connect)) => connect.execute(),
*/
#[cfg(feature = "static-artifact-create")]
Some(Cmd::GenCHeader(gen_heder)) => gen_heder.execute(),
#[cfg(feature = "wast")]
Expand Down
2 changes: 2 additions & 0 deletions lib/virtual-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ tracing = "0.1"
mio = { version = "0.8", features = [ "os-poll" ], optional = true }
socket2 = { version = "0.4", optional = true }
derivative = { version = "^2" }
futures = { version = "0.3" }
serde = { version = "1.0", default-features = false, features = ["derive"] }

[features]
sys = [ "mio", "socket2" ]
3 changes: 2 additions & 1 deletion lib/virtual-io/src/interest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use serde::{Deserialize, Serialize};
use std::{
collections::{HashMap, HashSet},
sync::{Arc, Mutex},
Expand All @@ -6,7 +7,7 @@ use std::{

use derivative::Derivative;

#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, Clone, Serialize, Deserialize, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum InterestType {
Readable,
Writable,
Expand Down
2 changes: 2 additions & 0 deletions lib/virtual-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ mod guard;
mod interest;
#[cfg(feature = "sys")]
mod selector;
pub mod waker;

#[cfg(feature = "sys")]
pub use guard::*;
pub use interest::*;
#[cfg(feature = "sys")]
pub use selector::*;
pub use waker::*;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct InlineWaker {
condvar: Condvar,
}
impl InlineWaker {
fn new() -> Arc<Self> {
pub fn new() -> Arc<Self> {
Arc::new(Self {
lock: Mutex::new(()),
condvar: Condvar::new(),
Expand All @@ -28,7 +28,7 @@ impl InlineWaker {
self.condvar.notify_all();
}

fn as_waker(self: &Arc<Self>) -> Waker {
pub fn as_waker(self: &Arc<Self>) -> Waker {
let s: *const Self = Arc::into_raw(Arc::clone(self));
let raw_waker = RawWaker::new(s as *const (), &VTABLE);
unsafe { Waker::from_raw(raw_waker) }
Expand Down
28 changes: 25 additions & 3 deletions lib/virtual-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,38 @@ thiserror = "1"
bytes = "1.1"
async-trait = { version = "^0.1" }
tracing = "0.1"
tokio = { version = "1", features = [ "net", "rt" ], default_features = false, optional = true }
tokio = { version = "1", default_features = false, optional = true }
libc = { version = "0.2.139", optional = true }
mio = { version = "0.8", optional = true }
socket2 = { version = "0.4", optional = true }
derivative = { version = "^2" }
virtual-mio = { path = "../virtual-io", version = "0.1.0", default-features = false }
base64 = "0.21"
bincode = { version = "1.3" }
serde = { version = "1.0", default-features = false, features = ["derive"] }
pin-project-lite = "0.2.9"
futures-util = { version = "0.3" }
anyhow = "1.0"
tokio-serde = { version = "0.8", features = [ "bincode" ], optional = true }
tokio-util = { version = "0.6", features = ["codec"], optional = true }
hyper-tungstenite = { version = "0.10", optional = true }
hyper = { version = "0.14", optional = true }
tokio-tungstenite = { version = "0.19", optional = true }

[dev-dependencies]
tokio = { version = "1", default_features = false, features = [ "macros" ] }
tracing-test = { version = "0.2" }

[features]
host-net = [ "tokio", "libc", "virtual-mio/sys", "tokio/net", "socket2", "mio" ]
default = [ "host-net", "remote", "json", "messagepack", "cbor", "hyper", "tokio-tungstenite" ]
host-net = [ "tokio", "libc", "tokio/io-util", "virtual-mio/sys", "tokio/net", "tokio/rt", "socket2", "mio" ]
remote = [ "tokio", "libc", "tokio/io-util", "tokio/sync", "tokio-serde", "tokio-util" ]
json = [ "tokio-serde/json" ]
messagepack = [ "tokio-serde/messagepack" ]
cbor = [ "tokio-serde/cbor" ]
hyper = [ "hyper-tungstenite", "dep:hyper" ]
tokio-tungstenite = [ "dep:tokio-tungstenite" ]

[package.metadata.docs.rs]
features = ["host-net"]
features = ["host-net", "remote"]
rustc-args = ["--cfg", "docsrs"]
Loading

0 comments on commit ff0680d

Please sign in to comment.