Skip to content

Conversation

@vforvideo
Copy link
Contributor

idea

clash-core has external control that support restful api for external control. That makes it easy for third part GUI to manipulate it. So I think it's a good idea for python proxy.

This pr is draft for this idea. I'd like to hear your suggestions about it. :)

usage

Add a new protocol called httpadmin, which handle http request. So user can add admin port:

%pproxy-lhttp://localhost:8080-lhttpadmin://localhost:8081

At beginning stage, two api entries are added.

Show server status

%curl'localhost:8081/status'

Show server configs (list argv)

%curl'localhost:8081/configs'

Modify server configs (use new argv)

%curl'localhost:8081/configs'-XPOST-d'-l http://localhost:8082 -l httpadmin://localhost:8081'

known issues (todo)

  • it's dangerous to expose admin port, auth is necessary
  • hot reload uses raise KeyInterrupt, maybe there's more elegant way

@vforvideovforvideo marked this pull request as draft January 21, 2024 09:24
@qwjqwj marked this pull request as ready for review November 16, 2024 11:46
@qwjqwj merged commit f512359 into qwj:masterNov 16, 2024
Sign up for freeto 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.

2 participants

@vforvideo@qwj