-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: hysteria draft #217
feat: hysteria draft #217
Conversation
@@ -0,0 +1,43 @@ | |||
use std::sync::Arc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can put this under clash_lib/src/proxy/converters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
At present, hysteria2 can already perform tcp proxy, mainly udp proxy, brutal congestion, ports hopping has not been implemented, port hopping may be just a small problem. |
I'm busy these days. while I am spare, I could take a look. |
thanks, salamander obfs have been fixed, it work now |
Hey thank you guys. I see that you've fixed the problem, is there anything left to be done for this PR? |
@eauxxs the build is failed on Windows |
clash/tests/data/config/ss.yaml
Outdated
@@ -60,5 +60,5 @@ proxies: | |||
udp: true | |||
|
|||
rules: | |||
- MATCH, ss | |||
- MATCH, ss-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- MATCH, ss-01 | |
- MATCH, ss |
|
||
proxies: | ||
- name: "local" | ||
type: Hysteria2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: Hysteria2 | |
type: hysteria2 |
clash_lib/src/app/logging.rs
Outdated
@@ -6,6 +6,7 @@ use serde::Serialize; | |||
use tokio::sync::broadcast::Sender; | |||
|
|||
use tracing::debug; | |||
use tracing::Level; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use tracing::Level; |
clash_lib/src/app/logging.rs
Outdated
@@ -103,6 +104,11 @@ pub fn setup_logging( | |||
) | |||
.from_env_lossy(); | |||
|
|||
// let trace = tracing_subscriber::filter::targets::Targets::new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do something like this to enable the level RUST_LOG=h2=trace,clash=debug
@@ -53,6 +53,7 @@ pub enum OutboundProxyProtocol { | |||
Trojan(OutboundTrojan), | |||
#[serde(rename = "vmess")] | |||
Vmess(OutboundVmess), | |||
Hysteria2(OutboundHysteria2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hysteria2(OutboundHysteria2), | |
#[serde(rename = "hysteria2")] | |
Hysteria2(OutboundHysteria2), |
|
||
use crate::proxy::converters::hysteria2::PortGenrateor; | ||
|
||
pub struct UdpHop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please add a short description for this struct, such as what part it plays in the protocol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
println!("done"); | ||
// std::thread::sleep(std::time::Duration::from_secs(100000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// std::thread::sleep(std::time::Duration::from_secs(100000)); |
@@ -368,3 +371,53 @@ impl TryFrom<HashMap<String, Value>> for OutboundProxyProviderDef { | |||
.map_err(map_serde_error) | |||
} | |||
} | |||
|
|||
// #hysteria2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be great if you can convert these into the standard doc comment https://doc.rust-lang.org/rust-by-example/meta/doc.html
so that we might use them in future to generate the API references
|
||
struct Burtal; | ||
|
||
impl Controller for Burtal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used any where?
|
||
use quinn_proto::congestion::{Bbr, BbrConfig, Controller, ControllerFactory}; | ||
|
||
pub struct DynCongestion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file used at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current protocol still needs to implement the congestion algorithm and udp proxy. I will fix this part of the code next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not wait it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not wait it
哥们尽快吧,主要是最近比较忙,还生病了。
另外rust的quinn拥塞算法接口和go的那边还不一样,go这边有现成的,rust没有,工作还比较多。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
身体要紧。
如果有什么问题可以分享出来大家一起看。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
谢谢关心。目前就是拥塞算法,对照着go版本hysteria的brutal拥塞算法,它那里是计算丢包个数再进行调整发送速率,quinn接口只有丢包字节数,我问一下这个issue,目前还在看,不知道是否有更好的方法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看有回复,如果他的说法可行,提个PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not wait it
It looks like the problem is with borrowing-ssl, can we remove deps directory, and use boring crate directly, why it is necessary? |
@eauxxs Any blockers for this ? |
@ibigbug I'm very sorry that I just saw this news now. One is the problem of my work, and the other is the congestion control algorithm of quic. The other aspects of the protocol have been implemented. . . Regarding congestion control, I can only refer to the implementation of go, but I still don't know how to implement it. If you only use bbr, you can use it directly. |
No worries. Thanks for the update. I might be able to take it over when I get some time. |
I'm very sorry for taking so long. It's okay, I will rebase to the latest branch first. Then try to make a usable version. I like this project very much. . . I will give you feedback in time if I encounter any problems later. |
Much appreciated! |
42bd7f2
to
6e4b2a8
Compare
I ran the After capturing packets, I found that during the After modifying the
|
@lmmqxyx404 谢谢你的review。目前这个最新的提交只是基于最新的分支进行rebase。因为rustls,h3-quinn,quinn版本的更新,所以以前的代码也不可用了。这次pr也更新到了相关依赖的最新版本,而且有些方法重写了,但是我还没有时间来得及测试,如果你那边发现了问题,可以在这个分支上提交,一起工作。也可以另开一个分支,重用一些这个pr的代码,如果能用的到的话。 |
@eauxxs 我倒是挺想把这个功能实现的,不过主要是我能力有限。不知道改的方向,只好做一些琐碎的工作。 如果大哥有什么好的思路,就在这一起讨论下吧,万望不吝赐教。 |
我对于服务端的响应理解有误,原始go实现的 |
@eauxxs @ibigbug 我这边修改代码已经让hysteria2 协议跑起来了
改为
|
@eauxxs 看看? |
@lmmqxyx404 @ibigbug 这些都是些小问题,主要的问题是拥塞控制,还有一个问题是端口跳跃的问题。目前拥塞控制需要帮助。。 |
Signed-off-by: Yuwei Ba <[email protected]>
具体是什么问题呢?能不能具体说说,如果容易解决,我最近有空,可以再试着去解决下。 |
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge