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

subscription-userinfo header #15

Open
CaiJingLong opened this issue Feb 23, 2025 · 0 comments · May be fixed by #17
Open

subscription-userinfo header #15

CaiJingLong opened this issue Feb 23, 2025 · 0 comments · May be fixed by #17
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@CaiJingLong
Copy link

In Clash, the subscription has standard response headers to determine remaining traffic, total traffic, and used traffic information. However, it seems to be cleared during the subscription conversion. Therefore, can it be transmitted directly to the client?

The current prompt is

subscription-userinfo: upload=3504429949; download=117896274662; total=787213563623; expire=

The clash-verge-rev define it in https://github.com/clash-verge-rev/clash-verge-rev/blob/main/src-tauri/src/config/prfitem.rs#L64-L69

#[derive(Default, Debug, Clone, Copy, Deserialize, Serialize)]
pub struct PrfExtra {
    pub upload: u64,
    pub download: u64,
    pub total: u64,
    pub expire: u64,
}

The fields upload, download, and total are in bytes, while expire is a unit timestamp in seconds.

But actually, it just needs to pass back the response headers.

@Frank-Copilot Frank-Copilot linked a pull request Feb 23, 2025 that will close this issue
@kobe-koto kobe-koto added enhancement New feature or request help wanted Extra attention is needed labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants