Giter Site home page Giter Site logo

watfaq / clash-rs Goto Github PK

View Code? Open in Web Editor NEW
635.0 635.0 46.0 25.04 MB

custom protocol network proxy

Home Page: https://watfaq.gitbook.io/clashrs-user-manual/

License: Apache License 2.0

Rust 99.54% Python 0.29% Dockerfile 0.01% HTML 0.14% Makefile 0.02%
clash clash-rs clashrs hsalc ios proxy rust vpn

clash-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

clash-rs's Issues

Could change boringssl to openssl?

Currently, the vendor library boringssl needs too many pre-requirements, and I cannot build this project on my macOs, which reports the error:

clang: error: unsupported argument '-g' to option 'Wa,'

Could change boringssl to openssl to simplify the process of installing dependencies?

tun

  • tcp
  • udp
    • clean up udp NAT

Http2Config's host field not match the opt in Http2Option

this is likely to be a bug in vmess implementation with http2 as the transport

i've tested the config combination of vmess + h2, but encounter the broken pipe error, and after i debug the network traffic with wireshark, i found that the v2ray server return a 404 not found.

2024-03-15_23-53

After digging into the v2ray's source code, i found that v2ray calls isValidHost after receiving the request, what the isValidHost does is simple as well:

It just compare the host in the request header with the hosts in server's config. If no item is matched, the vmess server's transport layer will return 404.

func (c *Config) getHosts() []string {
	if len(c.Host) == 0 {
		return []string{"www.example.com"}
	}
	return c.Host
}

func (c *Config) isValidHost(host string) bool {
	hosts := c.getHosts()
	for _, h := range hosts {
		if h == host {
			return true
		}
	}
	return false
}

Back to our rust code, it seems that the h2_builder use the wrong hosts

let h2_builder = Http2Config {
    hosts: vec![self.opts.server.clone()],
    method: http::Method::GET,
    headers: HashMap::new(),
    path: opt.path.to_owned().try_into().expect("invalid H2 path"),
};

the fix is also simple: change the vec![self.opts.server.clone()] into opt.host.clone()

Switching from an error node to a normal node needs to restart the core

When using node A, once the node A becoms error, then manually switch from node A to a work node B, I must restart the clash-rs, then the traffic proxy can work.

The relevant logs are:

2024-01-08 10:49:25 INFO - [clash]: 2024-01-08T02:49:25.166858Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:49:25 INFO - [clash]: 2024-01-08T02:49:25.299102Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:49:25 INFO - [clash]: 2024-01-08T02:49:25.299141Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:49:25 INFO - [clash]: 2024-01-08T02:49:25.395064Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:49:25 INFO - [clash]: 2024-01-08T02:49:25.395154Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.527143Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.527173Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.702915Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.702946Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.703303Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.703330Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.710480Z  WARN clash_lib/src/proxy/transport/grpc.rs:83: grpc handshake resp err: Some(Ok(b"error code: 520"))

2024-01-08 10:51:06 INFO - [clash]: 2024-01-08T02:51:06.710506Z  WARN clash_lib/src/proxy/transport/grpc.rs:173: grpc initialization error


The clash-premium does not have this issue.

shadow-tls implementation

Motivation

The shadow-tls protocol may be one of safest protocol now? (I've used the shadow-tls-v3 for a long time, it's pretty stable)

Current implementation in other repos

Status quo:

  • in golang, the shadowtls client use the utls to hack the client hello packet
  • in rust, since the TLS is rely on rustls, the monoio & tokio version of client both modify the rustls and change some code in the process of building client hello

what we need to do

  1. fork a rustls & tokio-rustls, do some changes similar to shadow-tls-tokio-client
  2. patch the Cargo.toml
  3. add shadowtls's option in the shadowsocks's plugin
  4. reuse the code of shadow-tls-tokio-client

I had fully implement this protocol in my local environment and had it fully tested, however, i don't know what's the best way to handle the dependency of the hacked rustls & tokio-rustls: should i maintain the code by myself, or should we create a organization, and move the forked repos(rust-tun, netstack-lwip .etc ) to it?

Roadmap

  • inbounds
    • http
    • socks5
    • mix port
    • #73
    • authentication
  • proxy rules
    • groups
      • relay
      • select
      • urltest
      • loadbalance
      • fallback
    • proxies
      • #161
      • ss
      • socks5
        • with TLS
      • vmess
        • ws
        • aead and non-aead
      • #70
      • ...
      • #190
        • h2
        • #69
        • tls
        • http
  • providers
    • file
    • remote
  • rules
    • domain_keyword
    • domain_suffix
    • geoip
    • ipcidr
    • port
    • #71
    • #60
  • DNS
    • clients
      • DoH
      • DoT
      • UDP/TCP
      • dhcp
    • server
    • HTTP query
  • API
    • proxies
    • configs
    • logs (TODO: log format)
    • providers
    • rules
    • #62
    • #63
  • linux support
  • arm support #180
  • #72
  • #64
  • #65
  • what else?

known transports/protocols (unimplemented)

Please comment/vote up the transport that you'd like to have and implementation will be prioritized upon the popularity.

Pull requests are also more than welcomed.

Known transports:

more well known:

As well as more, those that have lost maintainers, or aren't used by many users, if there's a demand, integrating protocols could be considered.

ref: #59 (comment)

armv8 not supported

BoringSSL supports arm64 android, but doesn't seem to support arm v8 for general purpose machines, which also means that clash-rs can't compile programs for arm v8 for general purpose machines because clash-rs uses BoringSSL, is that right?

try Dockerfile build binary

I am make this Dockerfile

FROM rust:latest as builder
WORKDIR /workdir
COPY . .

RUN chmod +x ./scripts/build.sh && \
    sh ./scripts/build.sh x86_64-unknown-linux-gnu && \
    cp ./target/artifacts/clash-x86_64-unknown-linux-gnu /usr/local/cargo/bin/clash-rs

FROM debian:bullseye-slim
RUN apt-get update && apt-get install -y cmake && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/clash-rs /usr/local/bin/clash-rs
CMD ["clash-rs", "--version"]

then docker build . -t name

output error:

 => ERROR [builder 4/4] RUN chmod +x ./scripts/build.sh &&     sh ./scripts/build.sh x86_64-unknown-linux-gnu &&     cp ./target/artifacts/cla  174.6s
------
 > [builder 4/4] RUN chmod +x ./scripts/build.sh &&     sh ./scripts/build.sh x86_64-unknown-linux-gnu &&     cp ./target/artifacts/clash-x86_64-unknown-linux-gnu /usr/local/cargo/bin/clash-rs:
0.189 + [ ! -d target/artifacts ]
0.189 + mkdir -p target/artifacts
0.191 + echo x86_64-unknown-linux-gnu
0.192 + tr -d \n
0.192 + tr -d \r
0.192 + tr -d [:space:]
0.193 + TARGET=x86_64-unknown-linux-gnu
0.193 + echo building for x86_64-unknown-linux-gnu
0.193 + rustup target add x86_64-unknown-linux-gnu
0.193 building for x86_64-unknown-linux-gnu
0.283 info: component 'rust-std' for target 'x86_64-unknown-linux-gnu' is up to date
0.285 + cargo build -p clash --target x86_64-unknown-linux-gnu --release
0.383     Updating crates.io index
1.570     Updating git repository `https://github.com/Watfaq/boring.git`
5.109     Updating git submodule `https://github.com/google/boringssl.git`
57.70     Updating git submodule `https://github.com/google/boringssl.git`
110.1     Updating git repository `https://github.com/Watfaq/netstack-lwip.git`
118.5     Updating git repository `https://github.com/Watfaq/shadowsocks-rust.git`
123.5     Updating git repository `https://github.com/Watfaq/rust-tun.git`
129.6  Downloading crates ...
131.2   Downloaded alloc-stdlib v0.2.2
131.6   Downloaded time v0.3.29
131.6   Downloaded form_urlencoded v1.2.0
131.6   Downloaded foreign-types-shared v0.3.1
131.6   Downloaded ctr v0.9.2
131.6   Downloaded same-file v1.0.6
131.6   Downloaded crypto-common v0.1.6
131.6   Downloaded match_cfg v0.1.0
131.6   Downloaded shadowsocks-crypto v0.5.1
131.7   Downloaded rustc_version v0.4.0
131.7   Downloaded pin-utils v0.1.0
131.7   Downloaded dhcproto v0.10.0
131.7   Downloaded byte_string v1.0.0
131.7   Downloaded anstyle-parse v0.2.1
131.7   Downloaded pin-project-lite v0.2.13
131.8   Downloaded ecdsa v0.14.8
131.8   Downloaded anyhow v1.0.75
131.8   Downloaded elliptic-curve v0.12.3
131.8   Downloaded tokio-util v0.7.10
131.9   Downloaded ip_network_table v0.2.0
131.9   Downloaded hyper v0.14.27
131.9   Downloaded headers-core v0.2.0
131.9   Downloaded clap v2.34.0
131.9   Downloaded instant v0.1.12
131.9   Downloaded rustls v0.21.8
131.9   Downloaded peeking_take_while v0.1.2
131.9   Downloaded regex-syntax v0.6.29
132.0   Downloaded regex-syntax v0.8.2
132.0   Downloaded lazycell v1.3.0
132.0   Downloaded inotify-sys v0.1.5
132.0   Downloaded axum-core v0.3.4
132.0   Downloaded spin v0.5.2
132.0   Downloaded tracing v0.1.40
132.0   Downloaded time-core v0.1.2
132.0   Downloaded ed25519 v1.5.3
132.0   Downloaded rand v0.8.5
132.0   Downloaded equivalent v1.0.1
132.0   Downloaded itertools v0.11.0
132.0   Downloaded endian-type v0.1.2
132.0   Downloaded fnv v1.0.7
132.0   Downloaded itoa v1.0.9
132.1   Downloaded ioctl-sys v0.8.0
132.1   Downloaded matches v0.1.10
132.1   Downloaded enum-as-inner v0.6.0
132.1   Downloaded textwrap v0.11.0
132.1   Downloaded futures-task v0.3.29
132.1   Downloaded tower-layer v0.3.2
132.1   Downloaded deranged v0.3.8
132.1   Downloaded anstyle v1.0.3
132.1   Downloaded enum-as-inner v0.5.1
132.1   Downloaded matchit v0.7.3
132.1   Downloaded data-encoding v2.4.0
132.1   Downloaded humantime v2.1.0
132.1   Downloaded prost-derive v0.12.1
132.1   Downloaded inotify v0.9.6
132.1   Downloaded async-trait v0.1.74
132.1   Downloaded parking_lot_core v0.9.8
132.1   Downloaded which v4.4.2
132.1   Downloaded network-interface v1.1.1
132.1   Downloaded lru-cache v0.1.2
132.1   Downloaded bitflags v1.3.2
132.1   Downloaded murmur3 v0.5.2
132.1   Downloaded glob v0.3.1
132.1   Downloaded http-body v0.4.5
132.1   Downloaded num_cpus v1.16.0
132.1   Downloaded blake2 v0.10.6
132.1   Downloaded unicode-bidi v0.3.13
132.1   Downloaded proc-macro2 v1.0.67
132.1   Downloaded base64 v0.13.1
132.1   Downloaded tower-http v0.4.4
132.2   Downloaded ppv-lite86 v0.2.17
132.2   Downloaded home v0.5.5
132.2   Downloaded rand_chacha v0.3.1
132.2   Downloaded version_check v0.9.4
132.2   Downloaded percent-encoding v2.3.0
132.2   Downloaded curve25519-dalek v4.0.0-rc.3
132.2   Downloaded fslock v0.2.1
132.2   Downloaded serde_yaml v0.9.27
132.2   Downloaded boringtun v0.6.0
132.2   Downloaded foreign-types-macros v0.2.3
132.2   Downloaded memchr v2.6.3
132.2   Downloaded integer-encoding v3.0.4
132.2   Downloaded linked-hash-map v0.5.6
132.2   Downloaded clap_lex v0.6.0
132.2   Downloaded zeroize v1.6.0
132.2   Downloaded errno v0.3.3
132.2   Downloaded futures-sink v0.3.29
132.2   Downloaded untrusted v0.9.0
132.2   Downloaded rustversion v1.0.14
132.2   Downloaded arrayref v0.3.7
132.2   Downloaded either v1.9.0
132.3   Downloaded linux-raw-sys v0.4.10
132.3   Downloaded urlencoding v2.1.3
132.3   Downloaded quote v1.0.33
132.3   Downloaded h2 v0.3.21
132.3   Downloaded hashbrown v0.12.3
132.3   Downloaded state v0.6.0
132.3   Downloaded crypto-bigint v0.4.9
132.3   Downloaded hex v0.4.3
132.3   Downloaded tokio-stream v0.1.14
132.3   Downloaded ryu v1.0.15
132.4   Downloaded clap_derive v4.4.7
132.4   Downloaded nu-ansi-term v0.46.0
132.4   Downloaded ordered-float v2.10.0
132.4   Downloaded pin-project v1.1.3
132.4   Downloaded sha2 v0.10.8
132.4   Downloaded want v0.3.1
132.4   Downloaded indexmap v1.9.3
132.4   Downloaded opentelemetry-jaeger v0.19.0
132.4   Downloaded atty v0.2.14
132.4   Downloaded semver v1.0.19
132.4   Downloaded sec1 v0.3.0
132.4   Downloaded nix v0.25.1
132.4   Downloaded tokio-tfo v0.2.2
132.4   Downloaded idna v0.4.0
132.4   Downloaded syn v1.0.109
132.5   Downloaded utf-8 v0.7.6
132.5   Downloaded radix_trie v0.2.1
132.5   Downloaded x25519-dalek v2.0.0-rc.3
132.5   Downloaded ip_network_table-deps-treebitmap v0.5.0
132.5   Downloaded hashbrown v0.14.0
132.5   Downloaded hickory-client v0.24.0
132.5   Downloaded chacha20poly1305 v0.10.1
132.5   Downloaded lock_api v0.4.10
132.5   Downloaded opentelemetry_api v0.20.0
132.5   Downloaded ipnetwork v0.18.0
132.5   Downloaded ghash v0.5.0
132.5   Downloaded curve25519-dalek-derive v0.1.0
132.5   Downloaded unicode-width v0.1.11
132.5   Downloaded bytes v1.5.0
132.5   Downloaded arc-swap v1.6.0
132.5   Downloaded time-macros v0.2.15
132.5   Downloaded trust-dns-resolver v0.23.0
132.5   Downloaded opentelemetry-http v0.9.0
132.5   Downloaded idna v0.2.3
132.5   Downloaded clang-sys v1.6.1
132.5   Downloaded bitflags v2.4.0
132.5   Downloaded socket2 v0.4.9
132.5   Downloaded utf8parse v0.2.1
132.5   Downloaded opentelemetry v0.20.0
132.6   Downloaded opaque-debug v0.3.0
132.6   Downloaded erased-serde v0.3.31
132.6   Downloaded httpdate v1.0.3
132.6   Downloaded walkdir v2.4.0
132.6   Downloaded http-range-header v0.3.1
132.6   Downloaded overload v0.1.1
132.6   Downloaded strsim v0.8.0
132.6   Downloaded sharded-slab v0.1.4
132.6   Downloaded thiserror-impl v1.0.50
132.6   Downloaded url v2.4.1
132.6   Downloaded base64 v0.21.5
132.6   Downloaded der v0.6.1
132.6   Downloaded crossbeam-channel v0.5.8
132.6   Downloaded mime v0.3.17
132.6   Downloaded hickory-server v0.24.0
132.6   Downloaded mio v0.8.8
132.6   Downloaded unicode-normalization v0.1.22
132.6   Downloaded opentelemetry-semantic-conventions v0.12.0
132.6   Downloaded nom v7.1.3
132.6   Downloaded serde_json v1.0.107
132.7   Downloaded tokio-tungstenite v0.20.1
132.7   Downloaded serde_derive v1.0.191
132.7   Downloaded threadpool v1.8.1
132.7   Downloaded bindgen v0.66.1
132.7   Downloaded sync_wrapper v0.1.2
132.7   Downloaded p256 v0.11.1
132.7   Downloaded futures-macro v0.3.29
132.7   Downloaded uuid v1.5.0
132.7   Downloaded tinyvec v1.6.0
132.7   Downloaded ipnet v2.9.0
132.7   Downloaded webpki-roots v0.25.2
132.7   Downloaded cc v1.0.83
132.7   Downloaded tungstenite v0.20.1
132.7   Downloaded regex v1.10.2
132.7   Downloaded futures-io v0.3.29
132.7   Downloaded parking_lot_core v0.8.6
132.8   Downloaded rustix v0.38.21
132.8   Downloaded dhcproto-macros v0.1.0
132.8   Downloaded futures v0.3.29
132.8   Downloaded crc32fast v1.3.2
132.8   Downloaded nibble_vec v0.1.0
132.8   Downloaded futures-core v0.3.29
132.8   Downloaded chrono v0.4.31
132.8   Downloaded p384 v0.11.2
132.8   Downloaded regex-automata v0.1.10
132.8   Downloaded thrift v0.17.0
132.8   Downloaded bindgen v0.69.1
132.9   Downloaded resolv-conf v0.7.0
132.9   Downloaded cexpr v0.6.0
132.9   Downloaded thread_local v1.1.7
132.9   Downloaded tracing-core v0.1.32
132.9   Downloaded hkdf v0.12.3
132.9   Downloaded clap_builder v4.4.7
132.9   Downloaded smallvec v1.11.1
132.9   Downloaded trust-dns-proto v0.23.0
132.9   Downloaded ring-compat v0.5.1
132.9   Downloaded libc v0.2.150
133.0   Downloaded parking_lot v0.11.2
133.0   Downloaded blake3 v1.5.0
133.0   Downloaded futures-util v0.3.29
133.0   Downloaded rustls-webpki v0.101.7
133.0   Downloaded thiserror v1.0.50
133.0   Downloaded scopeguard v1.2.0
133.0   Downloaded http v0.2.9
133.0   Downloaded ordered-float v3.9.1
133.0   Downloaded parking_lot v0.12.1
133.0   Downloaded futures-executor v0.3.29
133.0   Downloaded zeroize_derive v1.4.2
133.1   Downloaded byteorder v1.5.0
133.1   Downloaded tinyvec_macros v0.1.1
133.1   Downloaded unsafe-libyaml v0.2.9
133.1   Downloaded tokio-rustls v0.24.1
133.1   Downloaded tokio v1.33.0
133.1   Downloaded typenum v1.17.0
133.1   Downloaded iana-time-zone v0.1.57
133.1   Downloaded brotli-decompressor v2.5.0
133.2   Downloaded trust-dns-proto v0.22.0
133.2   Downloaded libloading v0.7.4
133.2   Downloaded hmac v0.12.1
133.2   Downloaded unicode-ident v1.0.12
133.2   Downloaded brotli v3.4.0
133.2   Downloaded once_cell v1.18.0
133.2   Downloaded num-traits v0.2.16
133.2   Downloaded prettyplease v0.2.15
133.2   Downloaded notify v6.1.1
133.2   Downloaded platforms v3.1.2
133.2   Downloaded headers v0.3.9
133.2   Downloaded linked_hash_set v0.1.4
133.2   Downloaded ip_network v0.4.1
133.3   Downloaded env_logger v0.9.3
133.3   Downloaded hostname v0.3.1
133.3   Downloaded futures-channel v0.3.29
133.3   Downloaded fs_extra v1.3.0
133.3   Downloaded ansi_term v0.12.1
133.3   Downloaded log v0.4.20
133.3   Downloaded httparse v1.8.0
133.3   Downloaded prost v0.12.1
133.3   Downloaded pkcs8 v0.9.0
133.3   Downloaded pin-project-internal v1.1.3
133.3   Downloaded serde_path_to_error v0.1.14
133.3   Downloaded chacha20 v0.9.1
133.3   Downloaded md-5 v0.10.6
133.3   Downloaded matchers v0.1.0
133.3   Downloaded const-oid v0.9.5
133.3   Downloaded polyval v0.6.1
133.3   Downloaded universal-hash v0.5.1
133.3   Downloaded untrusted v0.7.1
133.3   Downloaded strsim v0.10.0
133.3   Downloaded tower-service v0.3.2
133.3   Downloaded tracing-oslog v0.1.2
133.3   Downloaded getrandom v0.2.10
133.3   Downloaded vec_map v0.8.2
133.3   Downloaded block-buffer v0.10.4
133.3   Downloaded uuid-macro-internal v1.5.0
133.3   Downloaded signature v1.6.4
133.3   Downloaded rustc-hash v1.1.0
133.3   Downloaded opentelemetry_sdk v0.20.0
133.4   Downloaded foreign-types v0.5.0
133.4   Downloaded digest v0.10.7
133.4   Downloaded mime_guess v2.0.4
133.4   Downloaded poly1305 v0.8.0
133.4   Downloaded lru_time_cache v0.11.11
133.4   Downloaded heck v0.4.1
133.4   Downloaded hickory-resolver v0.24.0
133.4   Downloaded lazy_static v1.4.0
133.4   Downloaded anstream v0.6.1
133.4   Downloaded minimal-lexical v0.2.1
133.4   Downloaded tracing-subscriber v0.3.17
133.4   Downloaded cfg-if v1.0.0
133.4   Downloaded filetime v0.2.22
133.4   Downloaded public-suffix v0.1.0
133.4   Downloaded bindgen v0.59.2
133.4   Downloaded axum v0.6.20
133.4   Downloaded tracing-opentelemetry v0.21.0
133.4   Downloaded aes v0.8.3
133.4   Downloaded aho-corasick v1.1.1
133.5   Downloaded aes-gcm v0.10.3
133.5   Downloaded maxminddb v0.23.0
133.5   Downloaded serde v1.0.191
133.5   Downloaded socket2 v0.5.5
133.5   Downloaded clap v4.4.7
133.5   Downloaded crossbeam-utils v0.8.16
133.5   Downloaded sct v0.7.0
133.5   Downloaded tokio-macros v2.1.0
133.5   Downloaded alloc-no-stdlib v2.0.4
133.5   Downloaded ring v0.17.5
133.6   Downloaded slab v0.4.9
133.6   Downloaded spin v0.9.8
133.6   Downloaded base64ct v1.6.0
133.6   Downloaded unicase v2.7.0
133.6   Downloaded autocfg v1.1.0
133.6   Downloaded aead v0.5.2
133.6   Downloaded rustls-pemfile v1.0.3
133.6   Downloaded base16ct v0.1.1
133.6   Downloaded ring v0.16.20
133.7   Downloaded async-recursion v1.0.5
133.7   Downloaded spki v0.6.0
133.7   Downloaded cipher v0.4.4
133.7   Downloaded signal-hook-registry v1.4.1
133.8   Downloaded sendfd v0.4.3
133.8   Downloaded antidote v1.0.0
133.8   Downloaded tracing-log v0.1.3
133.8   Downloaded colorchoice v1.0.0
133.8   Downloaded syn v2.0.37
133.8   Downloaded inout v0.1.3
133.8   Downloaded rand_core v0.6.4
133.8   Downloaded try-lock v0.2.4
133.8   Downloaded subtle v2.5.0
133.8   Downloaded generic-array v0.14.7
133.8   Downloaded tracing-attributes v0.1.27
133.8   Downloaded cmake v0.1.50
133.8   Downloaded anstyle-query v1.0.0
133.8   Downloaded sha1 v0.10.6
133.8   Downloaded indexmap v2.0.0
133.8   Downloaded tower v0.4.13
133.8   Downloaded quick-error v1.2.3
133.8   Downloaded tracing-appender v0.2.2
133.8   Downloaded cpufeatures v0.2.9
133.8   Downloaded termcolor v1.3.0
133.8   Downloaded shlex v1.2.0
133.8   Downloaded arrayvec v0.7.4
133.8   Downloaded constant_time_eq v0.3.0
133.8   Downloaded serde_urlencoded v0.7.1
133.8   Downloaded regex-automata v0.4.3
133.9   Downloaded hickory-proto v0.24.0
134.0    Compiling proc-macro2 v1.0.67
134.0    Compiling unicode-ident v1.0.12
134.0    Compiling libc v0.2.150
134.0    Compiling cfg-if v1.0.0
134.0    Compiling autocfg v1.1.0
134.0    Compiling version_check v0.9.4
134.2    Compiling log v0.4.20
134.4    Compiling pin-project-lite v0.2.13
134.5    Compiling smallvec v1.11.1
134.6    Compiling quote v1.0.33
134.8    Compiling syn v2.0.37
134.8    Compiling once_cell v1.18.0
135.0    Compiling lock_api v0.4.10
135.1    Compiling typenum v1.17.0
135.2    Compiling generic-array v0.14.7
135.4    Compiling getrandom v0.2.10
135.5    Compiling rand_core v0.6.4
135.6    Compiling scopeguard v1.2.0
135.8    Compiling bytes v1.5.0
135.8    Compiling memchr v2.6.3
136.3    Compiling cc v1.0.83
136.6    Compiling futures-core v0.3.29
136.7    Compiling parking_lot_core v0.9.8
136.9    Compiling futures-sink v0.3.29
136.9    Compiling crypto-common v0.1.6
137.0    Compiling num_cpus v1.16.0
137.2    Compiling slab v0.4.9
137.2    Compiling futures-channel v0.3.29
137.4    Compiling futures-task v0.3.29
137.5    Compiling parking_lot v0.12.1
137.5    Compiling mio v0.8.8
137.6    Compiling subtle v2.5.0
137.7    Compiling futures-util v0.3.29
138.1    Compiling signal-hook-registry v1.4.1
138.2    Compiling socket2 v0.5.5
138.2    Compiling pin-utils v0.1.0
138.2    Compiling futures-io v0.3.29
138.3    Compiling tracing-core v0.1.32
138.4    Compiling itoa v1.0.9
138.5    Compiling thiserror v1.0.50
138.7    Compiling serde v1.0.191
138.7    Compiling glob v0.3.1
138.9    Compiling percent-encoding v2.3.0
139.0    Compiling ppv-lite86 v0.2.17
139.1    Compiling clang-sys v1.6.1
139.3    Compiling rand_chacha v0.3.1
139.4    Compiling block-buffer v0.10.4
139.5    Compiling digest v0.10.7
139.6    Compiling rand v0.8.5
139.6    Compiling async-trait v0.1.74
139.6    Compiling tokio-macros v2.1.0
139.8    Compiling futures-macro v0.3.29
139.8    Compiling tracing-attributes v0.1.27
140.3    Compiling thiserror-impl v1.0.50
140.5    Compiling tokio v1.33.0
141.4    Compiling tracing v0.1.40
141.6    Compiling serde_derive v1.0.191
141.7    Compiling zeroize_derive v1.4.2
142.4    Compiling zeroize v1.6.0
142.5    Compiling cpufeatures v0.2.9
142.6    Compiling fnv v1.0.7
142.6    Compiling aho-corasick v1.1.1
143.2    Compiling regex-syntax v0.8.2
145.5    Compiling regex-automata v0.4.3
145.7    Compiling http v0.2.9
146.9    Compiling indexmap v1.9.3
147.0    Compiling tinyvec_macros v0.1.1
147.1    Compiling minimal-lexical v0.2.1
147.2    Compiling bitflags v2.4.0
147.4    Compiling libloading v0.7.4
147.5    Compiling regex v1.10.2
147.6    Compiling nom v7.1.3
147.9    Compiling tinyvec v1.6.0
148.6    Compiling hashbrown v0.12.3
148.6    Compiling unicode-normalization v0.1.22
149.1    Compiling cexpr v0.6.0
149.2    Compiling shlex v1.2.0
149.3    Compiling peeking_take_while v0.1.2
149.3    Compiling lazycell v1.3.0
149.3    Compiling lazy_static v1.4.0
149.4    Compiling rustc-hash v1.1.0
149.4    Compiling unicode-bidi v0.3.13
149.4    Compiling form_urlencoded v1.2.0
149.5    Compiling ring v0.16.20
149.7    Compiling idna v0.4.0
150.0    Compiling heck v0.4.1
150.1    Compiling url v2.4.1
150.6    Compiling tokio-util v0.7.10
151.2    Compiling data-encoding v2.4.0
151.3    Compiling either v1.9.0
151.4    Compiling untrusted v0.7.1
151.5    Compiling spin v0.5.2
151.6    Compiling num-traits v0.2.16
151.7    Compiling rustix v0.38.21
152.0    Compiling const-oid v0.9.5
152.1    Compiling crossbeam-utils v0.8.16
152.4    Compiling der v0.6.1
152.5    Compiling ring v0.17.5
153.6    Compiling linux-raw-sys v0.4.10
156.8    Compiling h2 v0.3.21
157.0    Compiling futures-executor v0.3.29
157.2    Compiling inout v0.1.3
157.3    Compiling spin v0.9.8
157.4    Compiling home v0.5.5
157.5    Compiling untrusted v0.9.0
157.6    Compiling ipnet v2.9.0
158.1    Compiling opaque-debug v0.3.0
158.2    Compiling base64 v0.21.5
158.6    Compiling httparse v1.8.0
158.6    Compiling which v4.4.2
158.8    Compiling cipher v0.4.4
158.9    Compiling crossbeam-channel v0.5.8
159.3    Compiling universal-hash v0.5.1
159.3    Compiling unicase v2.7.0
159.4    Compiling tower-service v0.3.2
159.4    Compiling base16ct v0.1.1
159.5    Compiling bindgen v0.66.1
159.5    Compiling rustversion v1.0.14
159.7    Compiling semver v1.0.19
159.9    Compiling sec1 v0.3.0
160.2    Compiling enum-as-inner v0.6.0
160.9    Compiling http-body v0.4.5
161.0    Compiling sha1 v0.10.6
161.2    Compiling crypto-bigint v0.4.9
161.4    Compiling signature v1.6.4
161.4    Compiling anyhow v1.0.75
161.6    Compiling urlencoding v2.1.3
161.7    Compiling rustls v0.21.8
161.9    Compiling linked-hash-map v0.5.6
161.9    Compiling httpdate v1.0.3
162.0    Compiling prettyplease v0.2.15
162.0    Compiling elliptic-curve v0.12.3
162.1    Compiling opentelemetry_api v0.20.0
162.1    Compiling rustls-webpki v0.101.7
163.1    Compiling sct v0.7.0
163.2    Compiling aead v0.5.2
163.3    Compiling cmake v0.1.50
163.3    Compiling fslock v0.2.1
163.4    Compiling atty v0.2.14
163.5    Compiling byteorder v1.5.0
163.6    Compiling regex-syntax v0.6.29
163.6    Compiling match_cfg v0.1.0
163.6    Compiling bitflags v1.3.2
163.6    Compiling unicode-width v0.1.11
163.7    Compiling fs_extra v1.3.0
163.7    Compiling mime v0.3.17
163.9    Compiling try-lock v0.2.4
163.9    Compiling want v0.3.1
163.9    Compiling textwrap v0.11.0
164.0    Compiling hostname v0.3.1
164.1    Compiling rustc_version v0.4.0
164.3    Compiling ecdsa v0.14.8
164.5    Compiling ordered-float v3.9.1
164.8    Compiling tokio-stream v0.1.14
165.1    Compiling regex-automata v0.1.10
166.7    Compiling pin-project-internal v1.1.3
166.9    Compiling socket2 v0.4.9
167.2    Compiling syn v1.0.109
167.6    Compiling tower-layer v0.3.2
167.6    Compiling boring-sys v3.0.4 (https://github.com/Watfaq/boring.git?rev=24c006f#24c006fd)
167.7    Compiling quick-error v1.2.3
167.7    Compiling vec_map v0.8.2
167.8    Compiling ryu v1.0.15
168.0    Compiling bindgen v0.59.2
168.1    Compiling humantime v2.1.0
168.2    Compiling strsim v0.8.0
168.2    Compiling ansi_term v0.12.1
168.4    Compiling bindgen v0.69.1
168.4    Compiling platforms v3.1.2
168.6    Compiling termcolor v1.3.0
168.6    Compiling overload v0.1.1
168.7    Compiling base64ct v1.6.0
168.9    Compiling spki v0.6.0
168.9    Compiling env_logger v0.9.3
169.1    Compiling nu-ansi-term v0.46.0
169.2    Compiling clap v2.34.0
169.3    Compiling curve25519-dalek v4.0.0-rc.3
169.4    Compiling pin-project v1.1.3
169.5    Compiling resolv-conf v0.7.0
169.5    Compiling hyper v0.14.27
169.6 error: failed to run custom build command for `boring-sys v3.0.4 (https://github.com/Watfaq/boring.git?rev=24c006f#24c006fd)`
169.6
169.6 Caused by:
169.6   process didn't exit successfully: `/workdir/target/release/build/boring-sys-06b3d91f2747c55a/build-script-build` (exit status: 101)
169.6   --- stdout
169.6   cargo:rerun-if-env-changed=BORING_BSSL_PATH
169.6   cargo:rerun-if-env-changed=BORING_BSSL_INCLUDE_PATH
169.6   cargo:rerun-if-env-changed=BORING_BSSL_SOURCE_PATH
169.6   cargo:rerun-if-env-changed=BORING_SSL_PRECOMPILED_BCM_O
169.6   cargo:rerun-if-env-changed=BORINGSSL_BUILD_DIR
169.6   Initialized empty Git repository in /workdir/deps/boringssl/src/.git/
169.6
169.6   CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
169.6   CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
169.6   HOST_CMAKE_TOOLCHAIN_FILE = None
169.6   CMAKE_TOOLCHAIN_FILE = None
169.6   CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
169.6   CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
169.6   HOST_CMAKE_GENERATOR = None
169.6   CMAKE_GENERATOR = None
169.6   CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
169.6   CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
169.6   HOST_CMAKE_PREFIX_PATH = None
169.6   CMAKE_PREFIX_PATH = None
169.6   CMAKE_x86_64-unknown-linux-gnu = None
169.6   CMAKE_x86_64_unknown_linux_gnu = None
169.6   HOST_CMAKE = None
169.6   CMAKE = None
169.6   running: cd "/workdir/target/x86_64-unknown-linux-gnu/release/build/boring-sys-96644712df04612f/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/workdir/deps/boringssl/src" "-DCMAKE_INSTALL_PREFIX=/workdir/target/x86_64-unknown-linux-gnu/release/build/boring-sys-96644712df04612f/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=MinSizeRel"
169.6
169.6   --- stderr
169.6   hint: Using 'master' as the name for the initial branch. This default branch name
169.6   hint: is subject to change. To configure the initial branch name to use in all
169.6   hint: of your new repositories, which will suppress this warning, call:
169.6   hint:
169.6   hint:   git config --global init.defaultBranch <name>
169.6   hint:
169.6   hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
169.6   hint: 'development'. The just-created branch can be renamed via this command:
169.6   hint:
169.6   hint:   git branch -m <name>
169.6
169.6   thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:
169.6
169.6   failed to execute command: No such file or directory (os error 2)
169.6   is `cmake` not installed?
169.6
169.6   build script failed, must exit now
169.6   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
169.6 warning: build failed, waiting for other jobs to finish...
------
Dockerfile:5
--------------------
   4 |
   5 | >>> RUN chmod +x ./scripts/build.sh && \
   6 | >>>     sh ./scripts/build.sh x86_64-unknown-linux-gnu && \
   7 | >>>     cp ./target/artifacts/clash-x86_64-unknown-linux-gnu /usr/local/cargo/bin/clash-rs
   8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c chmod +x ./scripts/build.sh &&     sh ./scripts/build.sh x86_64-unknown-linux-gnu &&     cp ./target/artifacts/clash-x86_64-unknown-linux-gnu /usr/local/cargo/bin/clash-rs" did not complete successfully: exit code: 101

I don't know if Docker containers are in your plans, I tried simply creating a docker build with no success, I'm wondering if this is a related dependency issue? Or is there something wrong with my dockerfile?

Thank you for your work.

Missing Web api

Original API abstract definition:

r.Get("/", hello)
r.Get("/logs", getLogs)
r.Get("/traffic", traffic)
r.Get("/memory", memory)
r.Get("/version", version)
r.Get("/configs", getConfigs)
r.Put("/configs", updateConfigs)
r.Post("/configs/geo", updateGeoDatabases)
r.Patch("/configs", patchConfigs)
r.Get("/proxies", getProxies)
r.Get("/proxies/{name}", getProxy)
r.Get("/proxies/{name}/delay", getProxyDelay)
r.Put("/proxies/{name}", updateProxy)
r.Get("/group", getGroups)
r.Get("/group/{name}", getGroup)
r.Get("/group/{name}/delay", getGroupDelay)
r.Get("/rules", getRules)
r.Get("/connections", getConnections)
r.Delete("/connections", closeAllConnections)
r.Delete("/connections/{id}", closeConnection)
r.Get("/providers/proxies", getProviders)
r.Get("/providers/proxies/{providerName}", getProvider)
r.Put("/providers/proxies/{providerName}", updateProvider)
r.Get("/providers/proxies/{providerName}/healthcheck", healthCheckProvider)
r.Get("/providers/proxies/{providerName}/{name}", getProxy)
r.Get("/providers/proxies/{providerName}/{name}/healthcheck", getProxyDelay)
r.Get("/providers/rules", getRuleProviders)
r.Put("/providers/rules/{name}", updateRuleProvider)
r.Post("/cache/fakeip/flush", flushFakeIPPool)
r.Get("/dns/query", queryDNS)
r.Post("/restart", restart)
r.Post("/upgrade", upgradeCore)
r.Post("/upgrade/ui", updateUI)

These api impl are missing:

iOS

怎么打出ios的包

Windows arm64 build requirements

It was blocked by ring 0.16, and get supported in ring 0.17:

These deps are using ring 0.16:

  • boringtun - master branch has got merged v0.17 support
  • hickory-client - master branch has got merged v0.17 support
    • but it still is blocked by rustls v0.21 due to sct v0.7.0, which is required ring v0.16

Other requirements haven't test yet - due to blocked by ring.

missing `-t` flag in cmd

It was used by custom ui, like verge, to verify whether a config file is vaild. If fails it will print error detial to stderr and exited with non-zero code.

vmess does not work properly from v0.1.11

  • Config: vmess + websocket +tls
  • Issue: vmess config works with clash-rs version v0.1.10, but not with v0.1.11.

Browser outputs when using v0.1.11:

ERR_TUNNEL_CONNECTION_FAILED

Screencast

2023-12-29-11-23-47.mp4

If you need me to provide the configuration, please let me know your email address and I will send it via email.

clash-rs runs slowly on my Windows 10 PC

Clash-RS runs slowly on my Windows 10 PC. It took almost 20 seconds to get it running and logging. And I don't see too much load when I look at the Performance section of the Task Manager.

I'm not sure if it's a system related issue or a hardware performance related issue.

Environment

  • OS: Windows 10 Pro 22H2 v19045.3803 (Clean Installation)
  • CPU: Intel Xeon CPU E5-2450 @ 2.10GHz
  • Memory: Samsung 1x8GB DDR3 1600 MHz
  • Hard Drive: WDC 1TB 7.2K RPM SATA 6Gbps 3.5'' HDD

Screencast

2024-01-06-16-55-18.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.