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

Update dependencies. Now geph4-protocol is compatiable with the newes… #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Update dependencies. Now geph4-protocol is compatiable with the newes…
…t sosistab2.
  • Loading branch information
lithedress committed Mar 1, 2024
commit 3f20d065654d996d0823359ebb613e46f63c8a8b
File renamed without changes.
2,096 changes: 1,161 additions & 935 deletions Cargo.lock

Large diffs are not rendered by default.

59 changes: 29 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ anyhow = "1.0.75"

async-h1 = "2.3.4"
bincode = "1.3.3"
flume = "0.10.14"
flume = "0.11.0"

os_pipe = "1.1.4"
dirs = "3.0.2"
ed25519-dalek = { version = "1.0.1", features = ["serde"] }
dirs = "5.0.1"
ed25519-dalek = { version = "2.1.1", features = ["serde", "pkcs8"] }
futures-util = "0.3.28"
hex = "0.4.3"
http-types = "2.12.0"
log = "0.4.20"
once_cell = "1.18.0"
parking_lot = { version = "0.11.2", features = ["serde"] }
parking_lot = { version = "0.12.1", features = ["serde"] }
rand = "0.7.3"
regex = "1.10.0"
rsa-fdh = "0.5.0"
Expand All @@ -41,30 +41,28 @@ scopeguard = "1.2.0"
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
sha2 = "0.9.9"
smol = "1.3.0"
smol = "2.0.0"
smol-timeout = "0.6.0"
socksv5 = "0.2.0"
socksv5 = "0.3.1"

strsim = "0.10.0"
strsim = "0.11.0"
structopt = "0.3.26"
x25519-dalek = { version = "1.2.0", features = ["serde"] }
x25519-dalek = { version = "2.0.1", features = ["serde"] }
chrono = "0.4.31"

socket2 = "0.3.19"
socket2 = "0.5.6"
treebitmap = { package = "ip_network_table-deps-treebitmap", version = "0.5.0" }
pnet_packet = "0.27.2"
governor = "0.3.2"
pnet_packet = "0.34.0"
governor = "0.6.3"
async-dup = "1.2.2"
bytes = { version = "1.5.0", features = ["serde"] }
tap = "1.0.1"
smolscale = "0.4.2"
async-compat = "0.2.2"
im = "15.1.0"
event-listener = "2.5.3"
cached = "0.23.0"
rustls = "0.19.1"
webpki-roots = "0.21.1"
strip-ansi-escapes = "0.1.1"
event-listener = "5.1.0"
cached = { version = "0.49.2", features = ["async"] }
strip-ansi-escapes = "0.2.0"

geph-nat = "0.1.6"
mizaru = "0.1.3"
Expand All @@ -73,21 +71,20 @@ geph4-aioutils = "0.1.5"

# socks2http
tokio = { version = "1.33.0", features = ["rt", "net", "io-util"] }
hyper = { version = "0.14.27", features = ["http1", "client", "server", "tcp", "stream"] }
hyper = { version = "0.14.28", features = ["http1", "client", "server", "tcp", "stream"] }
pin-project = "1.1.3"
http = "0.2.9"
psl = "2.1.4"
async-trait = "0.1.73"
tracing = "0.1.39"
env_logger = "0.9.3"
rlimit = "0.6.2"
env_logger = "0.11.2"
rlimit = "0.10.1"
binary-search = "0.1.2"
fastrand = "1.9.0"
fastrand = "2.0.1"

nanorpc = "0.1.12"

native-tls = { version = "0.2.11", features = ["vendored"] }
itertools = "0.10.5"
itertools = "0.12.1"
whoami = "1.4.1"
tiny_http = "0.12.0"
thiserror = "1.0.49"
Expand All @@ -96,11 +93,11 @@ shutdown_hooks = "0.1.0"
libc = "0.2.149"
signal-hook = "0.3.17"
dashmap = "5.5.3"
default-net = "0.11.0"
default-net = "0.22.0"
eff-wordlist = "1.0.2"
blake3 = "1.5.0"
byteorder = "1.5.0"
smol_str = "0.1.24"
smol_str = "0.2.1"


sosistab2="0.10"
Expand All @@ -117,28 +114,30 @@ colored = "2.0.4"
pad = "0.1.6"
futures-intrusive = "0.5.0"
oneshot = "0.1.6"
io-lifetimes = "1.0.5"
rustix = "0.36.9"
io-lifetimes = "2.0.3"
rustix = "0.38.31"
tmelcrypt = "0.2.7"

geph4-protocol = "0.18.0"
# geph4-protocol = "0.18.0"
geph4-protocol = { git = "https://github.com/lithedress/geph4-protocol" }
# geph4-protocol = { git = "https://github.com/geph-official/geph4-protocol", branch = "user-info" }

melprot = "0.13.7"
acidjson = "0.1.3"
melstructs = "0.3.2"
gibbername = "0.1.1"
melbootstrap = "0.8.4"
moka = "0.11.3"
moka = "0.12.5"
async-once-cell = "0.5.3"
clone-macro = "0.1.0"
sqlx = {version="0.7.3", default-features=false, features=["sqlite", "runtime-tokio"]}
sqlx = { version = "0.7.3", default-features = false, features = ["sqlite", "runtime-tokio"] }
derivative = "2.2.0"
async-signal = "0.2.5"
reqwest = "0.11.24"
# tracing-subscriber = "0.2.15"

[target.'cfg(unix)'.dependencies]
tun = "0.5.5"
tun = "0.6.1"


[target.'cfg(windows)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/china/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::collections::HashSet;

use anyhow::Context;
use std::net::{IpAddr, Ipv4Addr};
use http_types::{Method, Request, Url};
use once_cell::sync::Lazy;
use std::net::{IpAddr, Ipv4Addr};
use treebitmap::IpLookupTable;

/// List of all Chinese domains.
Expand Down
9 changes: 4 additions & 5 deletions src/connect/tunnel/getsess.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bytes::Bytes;
use ed25519_dalek::ed25519::signature::Signature;
use ed25519_dalek::{PublicKey, Verifier};
use ed25519_dalek::{Signature, Verifier, VerifyingKey};
use futures_intrusive::sync::ManualResetEvent;
use futures_util::{stream::FuturesUnordered, Future, StreamExt};
use geph4_protocol::binder::protocol::BridgeDescriptor;
Expand Down Expand Up @@ -34,7 +33,7 @@ use std::{
};
use std::{net::IpAddr, time::Instant};

use std::{convert::TryFrom, sync::Arc, time::Duration};
use std::{sync::Arc, time::Duration};

pub fn parse_independent_endpoint(endpoint: &str) -> anyhow::Result<(SocketAddr, [u8; 32])> {
// parse endpoint addr
Expand All @@ -55,14 +54,14 @@ pub fn parse_independent_endpoint(endpoint: &str) -> anyhow::Result<(SocketAddr,

fn verify_exit_signatures(
bridges: &[BridgeDescriptor],
signing_key: PublicKey,
signing_key: VerifyingKey,
) -> anyhow::Result<()> {
for b in bridges.iter() {
// The exit signed this bridge with an empty signature, so we have to verify with an empty signature
let mut clean_bridge = b.clone();
clean_bridge.exit_signature = Bytes::new();

let signature = &Signature::from_bytes(b.exit_signature.as_ref())
let signature = &Signature::from_slice(b.exit_signature.as_ref())
.context("failed to deserialize exit signature")?;
let bridge_msg = bincode::serialize(&clean_bridge).unwrap();
let bridge_log_id = format!("[{}] {}/{}", b.protocol, b.exit_hostname, b.endpoint);
Expand Down
1 change: 0 additions & 1 deletion src/connect/tunnel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

use bytes::Bytes;

use derivative::Derivative;
Expand Down
7 changes: 0 additions & 7 deletions src/connect/vpn.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
use anyhow::Context;
use smol::future::FutureExt;

use super::ConnectContext;
use crate::config::VpnMode;

#[cfg(target_os = "linux")]
mod linux_routing;

#[cfg(target_os = "windows")]
mod windows_routing;

#[cfg(unix)]
use std::os::unix::prelude::{AsRawFd, FromRawFd};

pub(super) async fn vpn_loop(ctx: ConnectContext) -> anyhow::Result<()> {
#[cfg(any(target_os = "linux", target_os = "android"))]
if ctx.opt.vpn_mode == Some(VpnMode::InheritedFd) {
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mod fronts;

mod socks2http;

use cap::Cap;

use colored::Colorize;

use pad::{Alignment, PadStr};
Expand Down Expand Up @@ -80,16 +78,15 @@ fn config_logging(logs: Sender<String>) {
log::Level::Trace => "TRAC".bright_black(),
},
);
let len = strip_ansi_escapes::strip(&preamble).unwrap().len();
let len = strip_ansi_escapes::strip(&preamble).len();
let longest = LONGEST_LINE_EVER.fetch_max(len, Ordering::SeqCst);
let preamble = ""
.pad_to_width_with_alignment(longest.saturating_sub(len), Alignment::Right)
+ &preamble;
let line = format!("{} {}", preamble, record.args());
writeln!(buf, "{}", line).unwrap();
let _ = logs.try_send(
String::from_utf8_lossy(&strip_ansi_escapes::strip(line).unwrap()).to_string(),
);
let _ =
logs.try_send(String::from_utf8_lossy(&strip_ansi_escapes::strip(line)).to_string());
Ok(())
})
.format_target(false)
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use geph4client::dispatch;
fn main() -> anyhow::Result<()> {
smolscale::permanently_single_threaded();
let ((largest_low, _), _) = binary_search::binary_search((1, ()), (65536, ()), |lim| {
if rlimit::utils::increase_nofile_limit(lim).unwrap_or_default() >= lim {
if rlimit::increase_nofile_limit(lim).unwrap_or_default() >= lim {
Direction::Low(())
} else {
Direction::High(())
}
});
let _ = rlimit::utils::increase_nofile_limit(largest_low);
let _ = rlimit::increase_nofile_limit(largest_low);
log::info!("** set fd limit to {} **", largest_low);

dispatch()
Expand Down
2 changes: 0 additions & 2 deletions src/main_bridgetest.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


use serde::{Deserialize, Serialize};

use structopt::StructOpt;
Expand Down
4 changes: 2 additions & 2 deletions src/socks2http/http_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use crate::socks2http::address::{host_addr, Address};
use crate::socks2http::http_client;
use crate::socks2http::socks5;
use futures_util::FutureExt;
use http::{
use hyper::http::{
uri::{Authority, Scheme, Uri},
Method,
};
use http::{HeaderMap, HeaderValue, Version};
use hyper::http::{HeaderMap, HeaderValue, Version};
use hyper::{
server::conn::AddrStream,
service::{make_service_fn, service_fn},
Expand Down
2 changes: 1 addition & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub async fn sync_json(opt: SyncOpt) -> anyhow::Result<String> {
.into_iter()
.map(|exit| DumbedDownExitDescriptor {
hostname: exit.hostname.into(),
signing_key: hex::encode(exit.signing_key),
signing_key: hex::encode(exit.signing_key.to_bytes()),
country_code: exit.country_code.into(),
city_code: exit.city_code.into(),
allowed_levels: exit
Expand Down