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

feat: support clash premium's structured log stream #735

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

NyaMisty
Copy link

@NyaMisty NyaMisty commented Sep 7, 2023

New version of Clash for Windows uses ws://external-controller/logs?token=&level=info&format=structured to get real time log. When Clash Premium Core reveices format=structured, it returns a different form of JSON log entry. Supporting this feature will allow better Clash for Windows integration

hub/route/server.go Outdated Show resolved Hide resolved
New version of Clash for Windows uses `ws://external-controller/logs?token=&level=info&format=structured` to get real time log. When Clash Premium Core reveices `format=structured`, it returns a different form of JSON log entry. Supporting this feature will allow better Clash for Windows integration

Signed-off-by: Misty <gyc990326@gmail.com>
@@ -364,5 +395,5 @@ func getLogs(w http.ResponseWriter, r *http.Request) {
}

func version(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, render.M{"meta": C.Meta, "version": C.Version})
render.JSON(w, r, render.M{"mete": C.Meta, "version": C.Version})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

@wwqgtxx wwqgtxx merged commit 10e7c53 into MetaCubeX:Alpha Sep 29, 2023
Larvan2 pushed a commit that referenced this pull request Dec 2, 2023
* feat: support clash premium's structured log stream

New version of Clash for Windows uses `ws://external-controller/logs?token=&level=info&format=structured` to get real time log. When Clash Premium Core reveices `format=structured`, it returns a different form of JSON log entry. Supporting this feature will allow better Clash for Windows integration

Signed-off-by: Misty <gyc990326@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants