-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: master
Are you sure you want to change the base?
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 |
Signed-off-by: Yuwei Ba <[email protected]>
@@ -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? |
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self-Check before Merge