Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cb56d75
chore: refactor code base with .echo url name
suisun2022 Nov 26, 2025
cc4a30d
chore: update active.rs for speed enhancement
suisun2022 Nov 26, 2025
ebf93af
chore: update active.rs for speed enhancement
suisun2022 Nov 26, 2025
081e330
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
c3dd49c
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
105b1f4
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
081c42c
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
afea825
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
0365c73
chore: update active.rs for speed enhancement
suisun2022 Nov 27, 2025
69201fd
chore: update active.rs for speed enhancement
suisun2022 Dec 1, 2025
0900470
chore: update active.rs for speed enhancement
suisun2022 Dec 1, 2025
f7e91e7
chore: update active.rs for speed enhancement
suisun2022 Dec 1, 2025
2ac98fd
chore: update active.rs for speed enhancement
suisun2022 Dec 1, 2025
37301d8
chore: update active.rs for speed enhancement
suisun2022 Dec 1, 2025
552d450
Merge remote-tracking branch 'origin/feat/allow-known-relays' into fe…
soaring-shota Dec 8, 2025
3f2d63e
fix: update active.rs consts for speed enhancement
soaring-shota Dec 9, 2025
dba55b4
fix: update session to increase tags count to generate
soaring-shota Dec 9, 2025
761d838
fix: update tunnel event channel size from 64 to 8192
soaring-shota Dec 9, 2025
13466e9
fix: revert wrong updates
soaring-shota Dec 9, 2025
4ae1958
fix: revert wrong updates
soaring-shota Dec 9, 2025
32c6559
fix: update emissary-cli for better multi threading
soaring-shota Dec 9, 2025
ea7dfff
fix: update configuration value
soaring-shota Dec 9, 2025
1ce7645
fix: revert config changes
soaring-shota Dec 11, 2025
3f89a97
fix: update speed configuration
soaring-shota Dec 11, 2025
5095b8f
fix: update speed configuration
soaring-shota Dec 11, 2025
a2a8bea
fix: update tunnel pool event channel size
soaring-shota Dec 11, 2025
d7da0e9
fix: increased mtu size to 4000 at active.rs and packet.rs
soaring-shota Dec 11, 2025
32ec771
fix: increase tunnel channel size at transit.rs
soaring-shota Dec 11, 2025
4666312
chore: make server session inhound len to 1
soaring-shota Dec 12, 2025
8064c82
fix: increased window size
soaring-shota Dec 12, 2025
f5827d4
fix: revert window size to optimized value
soaring-shota Dec 12, 2025
d2ae360
fix: update ntcp2 session read_buffer size
soaring-shota Dec 12, 2025
c779e7d
fix: revert initial window size to 16
soaring-shota Dec 12, 2025
670e659
wip: update delay times
soaring-shota Dec 12, 2025
d52f4b4
chore: udpate buffer size
soaring-shota Dec 15, 2025
5675982
chore: increase window size
soaring-shota Dec 15, 2025
a126cb9
fix: increase mtu size
soaring-shota Dec 15, 2025
e9d3be4
fix: resolve conflicts with emissary updates
soaring-shota Jan 21, 2026
6708b0c
Merge branch 'feat/allow-known-relays' into feat/update-url-name
soaring-shota Jan 26, 2026
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions emissary-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ thiserror = "2.0.12"
tokio-tungstenite = { version = "0.27.0", default-features = false, features = ["native-tls"], optional = true }
url = "2.5.4"
base64 = "0.21"
num_cpus = "1.16"

# workspace dependencies
anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion emissary-cli/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ <h1>Client destinations</h1>

data.server_destinations.forEach(([key, value]) => {
const div = document.createElement("div");
div.textContent = `${key}: http://${value}.b32.i2p`;
div.textContent = `${key}: http://${value}.b32.echo`;
destContainer.appendChild(div);
});
}
Expand Down
152 changes: 76 additions & 76 deletions emissary-cli/src/address_book.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion emissary-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl Default for EmissaryConfig {
address_book: None,
// address_book: Some(AddressBookConfig {
// default: Some(String::from(
// "http://udhdrtrcetjm5sxzskjyr5ztpeszydbh4dpl3pl4utgqqw2v4jna.b32.i2p/hosts.txt",
// "http://udhdrtrcetjm5sxzskjyr5ztpeszydbh4dpl3pl4utgqqw2v4jna.b32.echo/hosts.txt",
// )),
// subscriptions: None,
// }),
Expand Down
36 changes: 18 additions & 18 deletions emissary-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use emissary_util::{
port_mapper::PortMapper, reseeder::Reseeder, runtime::tokio::Runtime, storage::Storage,
su3::ReseedRouterInfo,
};
use futures::{channel::oneshot, StreamExt};
use futures::{channel::oneshot, future, StreamExt};
use tokio::sync::mpsc::{channel, Receiver};

use std::{fs::File, io::Write, mem, pin::Pin, sync::Arc, path::PathBuf};
Expand Down Expand Up @@ -361,7 +361,7 @@ async fn setup_router(arguments: Arguments) -> anyhow::Result<RouterContext> {
// been built), it'll signal the address book that it can start download hosts file(s)
//
// additionally, acquire handle to address book which is passed to http proxy so it can
// resolve .i2p hosts to .b32.i2p hosts
// resolve .echo hosts to .b32.echo hosts
let (http_proxy_ready_tx, address_book_handle) = match address_book_manager {
None => (None, None),
Some(address_book_manager) => {
Expand Down Expand Up @@ -537,21 +537,15 @@ async fn router_event_loop(
// router.add_external_address(address.expect("value"));
},
_ = async {
loop {
let mut router_guard = router.lock().await;
let mut pinned_router = Pin::new(&mut *router_guard);
let waker = futures::task::noop_waker();
let mut cx = std::task::Context::from_waker(&waker);
match pinned_router.as_mut().poll(&mut cx) {
std::task::Poll::Ready(()) => return (),
std::task::Poll::Pending => {
drop(router_guard);
tokio::task::yield_now().await;
}
}
}
} => {
// _ = &mut router => {
// Poll router properly using tokio's async mechanism
future::poll_fn(|cx| {
let mut router_guard = match router.try_lock() {
Ok(guard) => guard,
Err(_) => return std::task::Poll::Pending,
};
Pin::new(&mut *router_guard).poll(cx)
}).await
} => {
tracing::info!(
target: LOG_TARGET,
"emissary shut down",
Expand Down Expand Up @@ -580,7 +574,13 @@ fn main() -> anyhow::Result<()> {

#[cfg(feature = "web-ui")]
fn main() -> anyhow::Result<()> {
let runtime = tokio::runtime::Runtime::new()?;
// let runtime = tokio::runtime::Runtime::new()?;
let runtime = tokio::runtime::Builder::new_multi_thread()
.worker_threads(num_cpus::get()) // Use all CPU cores
.enable_all()
.thread_stack_size(4 * 1024 * 1024) // 4MB stack per thread
.build()?;

let (shutdown_tx, shutdown_rx) = channel(1);
let arguments = runtime.block_on(parse_arguments());
let RouterContext {
Expand Down
2 changes: 1 addition & 1 deletion emissary-cli/src/proxy/http/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl std::fmt::Display for HttpError {
HttpError::MethodNotSupported(method) => write!(f, "Method not supported: {method}"),
HttpError::HostNotFound => write!(f, "Host not found in address book"),
HttpError::AddressBookNotEnabled =>
write!(f, "Cannot connect to .i2p host, address book not enabled"),
write!(f, "Cannot connect to .echo host, address book not enabled"),
HttpError::OutproxyNotEnabled => write!(
f,
"Cannot connect to clearnet address, outproxy not enabled"
Expand Down
74 changes: 37 additions & 37 deletions emissary-cli/src/proxy/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ impl HttpProxy {

// validate outproxy
//
// if the outproxy is given as a .b32.i2p host, it can be used as-is
// if the outproxy is given as a .b32.echo host, it can be used as-is
//
// if it's given as a .i2p host, it must be converted into a .b32.i2p host by doing a host
// if it's given as a .echo host, it must be converted into a .b32.echo host by doing a host
// lookup into address book
//
// if either address book is disabled or hostname is not found in it, outproxy is disabled
Expand All @@ -120,19 +120,19 @@ impl HttpProxy {
let outproxy = outproxy.strip_prefix("http://").unwrap_or(&outproxy);
let outproxy = outproxy.strip_prefix("www.").unwrap_or(outproxy);

match outproxy.ends_with(".i2p") {
match outproxy.ends_with(".echo") {
false => {
tracing::warn!(
target: LOG_TARGET,
%outproxy,
"outproxy must be .b32.i2p or .i2p hostname",
"outproxy must be .b32.echo or .echo hostname",
);
None
}
true => match (outproxy.ends_with(".b32.i2p"), &address_book_handle) {
true => match (outproxy.ends_with(".b32.echo"), &address_book_handle) {
(true, _) => Some(outproxy.to_owned()),
(false, Some(handle)) => match handle.resolve_base32(outproxy) {
Some(host) => Some(format!("{host}.b32.i2p")),
Some(host) => Some(format!("{host}.b32.echo")),
None => {
tracing::warn!(
target: LOG_TARGET,
Expand Down Expand Up @@ -197,8 +197,8 @@ impl HttpProxy {

/// Handle `request`.
///
/// Assembles the validated request into an actual HTTP request and resolves a .i2p host into a
/// .b32.i2p host if a .i2p host was used and if address book was enabled.
/// Assembles the validated request into an actual HTTP request and resolves a .echo host into a
/// .b32.echo host if a .echo host was used and if address book was enabled.
///
/// If the outbound request was for an outproxy, ensures that an outproxy has been configured.
///
Expand Down Expand Up @@ -457,7 +457,7 @@ mod tests {
.expect("to succeed");

match client
.get("http://zzz.i2p")
.get("http://zzz.echo")
.headers(HeaderMap::from_iter([(
CONNECTION,
HeaderValue::from_static("close"),
Expand All @@ -472,7 +472,7 @@ mod tests {
.text()
.await
.unwrap()
.contains("Cannot connect to .i2p host, address book not enabled"));
.contains("Cannot connect to .echo host, address book not enabled"));
}
};
}
Expand Down Expand Up @@ -526,7 +526,7 @@ mod tests {
.expect("to succeed");

match client
.get("http://zzz.i2p")
.get("http://zzz.echo")
.headers(HeaderMap::from_iter([(
CONNECTION,
HeaderValue::from_static("close"),
Expand Down Expand Up @@ -608,7 +608,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("outproxy.i2p".to_string()),
outproxy: Some("outproxy.echo".to_string()),
},
sam_port,
None,
Expand Down Expand Up @@ -677,7 +677,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("outproxy.i2p".to_string()),
outproxy: Some("outproxy.echo".to_string()),
},
sam_port,
None,
Expand Down Expand Up @@ -727,10 +727,10 @@ mod tests {

// create empty address book
let address_book = {
let hosts = "psi.i2p=avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a\n\
zerobin.i2p=3564erslxzaoucqasxsjerk4jz2xril7j2cbzd4p7flpb4ut67hq\n\
tracker2.postman.i2p=6a4kxkg5wp33p25qqhgwl6sj4yh4xuf5b3p3qldwgclebchm3eea\n\
zzz.i2p=lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua\n"
let hosts = "psi.echo=avviiexdngd32ccoy4kuckvc3mkf53ycvzbz6vz75vzhv4tbpk5a\n\
zerobin.echo=3564erslxzaoucqasxsjerk4jz2xril7j2cbzd4p7flpb4ut67hq\n\
tracker2.postman.echo=6a4kxkg5wp33p25qqhgwl6sj4yh4xuf5b3p3qldwgclebchm3eea\n\
zzz.echo=lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua\n"
.to_string();

let dir = tempdir().unwrap().keep();
Expand All @@ -754,7 +754,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("zzz.i2p".to_string()),
outproxy: Some("zzz.echo".to_string()),
},
sam_port,
None,
Expand All @@ -765,7 +765,7 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

Expand All @@ -775,7 +775,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("www.zzz.i2p".to_string()),
outproxy: Some("www.zzz.echo".to_string()),
},
sam_port,
None,
Expand All @@ -786,7 +786,7 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

Expand All @@ -796,7 +796,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("http://zzz.i2p".to_string()),
outproxy: Some("http://zzz.echo".to_string()),
},
sam_port,
None,
Expand All @@ -807,7 +807,7 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

Expand All @@ -817,7 +817,7 @@ mod tests {
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some("http://www.zzz.i2p".to_string()),
outproxy: Some("http://www.zzz.echo".to_string()),
},
sam_port,
None,
Expand All @@ -828,18 +828,18 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

// http://www. .b32.i2p host
// http://www. .b32.echo host
{
let proxy = HttpProxy::new(
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some(
"http://www.lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"http://www.lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
.to_string(),
),
},
Expand All @@ -852,18 +852,18 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

// http:// .b32.i2p host
// http:// .b32.echo host
{
let proxy = HttpProxy::new(
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some(
"http://lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"http://lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
.to_string(),
),
},
Expand All @@ -876,18 +876,18 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

// http:// .b32.i2p host
// http:// .b32.echo host
{
let proxy = HttpProxy::new(
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some(
"www.lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"www.lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
.to_string(),
),
},
Expand All @@ -900,18 +900,18 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}

// .b32.i2p host
// .b32.echo host
{
let proxy = HttpProxy::new(
HttpProxyConfig {
port: 0,
host: "127.0.0.1".to_string(),
outproxy: Some(
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p".to_string(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo".to_string(),
),
},
sam_port,
Expand All @@ -923,7 +923,7 @@ mod tests {

assert_eq!(
proxy.outproxy.as_ref().unwrap().as_str(),
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.i2p"
"lhbd7ojcaiofbfku7ixh47qj537g572zmhdc4oilvugzxdpdghua.b32.echo"
);
}
}
Expand Down
Loading