Skip to content

Commit

Permalink
pending ws + vmess
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Aug 27, 2023
1 parent 037035b commit e55cf11
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 262 deletions.
1 change: 1 addition & 0 deletions clash/tests/data/config/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ proxies:
cipher: auto
udp: true
skip-cert-verify: true
network: ws
ws-opts:
path: /api/v3/download.getFile
headers:
Expand Down
13 changes: 5 additions & 8 deletions clash_lib/src/proxy/vmess/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ impl Handler {
&'a self,
s: AnyStream,
sess: &'a Session,
resolver: ThreadSafeDNSResolver,
udp: bool,
) -> io::Result<AnyStream> {
let mut stream = s;
Expand Down Expand Up @@ -182,7 +181,7 @@ impl OutboundHandler for Handler {
resolver: ThreadSafeDNSResolver,
) -> io::Result<AnyStream> {
let stream = new_tcp_stream(
resolver.clone(),
resolver,
self.opts.server.as_str(),
self.opts.port,
self.opts.common_opts.iface.as_ref(),
Expand All @@ -198,17 +197,17 @@ impl OutboundHandler for Handler {
})
.await?;

self.inner_proxy_stream(stream, sess, resolver, false).await
self.inner_proxy_stream(stream, sess, false).await
}

/// wraps a stream with outbound handler
async fn proxy_stream(
&self,
s: AnyStream,
sess: &Session,
resolver: ThreadSafeDNSResolver,
_: ThreadSafeDNSResolver,
) -> io::Result<AnyStream> {
self.inner_proxy_stream(s, sess, resolver, false).await
self.inner_proxy_stream(s, sess, false).await
}

async fn connect_datagram(
Expand Down Expand Up @@ -241,9 +240,7 @@ impl OutboundHandler for Handler {
format!("failed to resolve {}", sess.destination.host()).as_str(),
))?;

let stream = self
.inner_proxy_stream(stream, sess, resolver, true)
.await?;
let stream = self.inner_proxy_stream(stream, sess, true).await?;

Ok(Box::new(OutboundDatagramVmess::new(
stream,
Expand Down
59 changes: 0 additions & 59 deletions clash_lib/src/proxy/vmess/vmess_impl/tls/macos.rs

This file was deleted.

12 changes: 0 additions & 12 deletions clash_lib/src/proxy/vmess/vmess_impl/tls/mod.rs

This file was deleted.

141 changes: 0 additions & 141 deletions clash_lib/src/proxy/vmess/vmess_impl/tls/stream.rs

This file was deleted.

16 changes: 0 additions & 16 deletions clash_lib/src/proxy/vmess/vmess_impl/tls/unix.rs

This file was deleted.

26 changes: 0 additions & 26 deletions clash_lib/src/proxy/vmess/vmess_impl/tls/windows.rs

This file was deleted.

0 comments on commit e55cf11

Please sign in to comment.