mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
feat(auth, docs): add SDK guides and local password support for management
- Added extensive SDK usage guides for `cliproxy`, `sdk/access`, and watcher integration. - Introduced `--password` flag for specifying local management access passwords. - Enhanced management API with local password checks to secure localhost requests. - Updated documentation to reflect the new password functionality.
This commit is contained in:
@@ -21,10 +21,12 @@ import (
|
||||
// Parameters:
|
||||
// - cfg: The application configuration
|
||||
// - configPath: The path to the configuration file
|
||||
func StartService(cfg *config.Config, configPath string) {
|
||||
// - localPassword: Optional password accepted for local management requests
|
||||
func StartService(cfg *config.Config, configPath string, localPassword string) {
|
||||
service, err := cliproxy.NewBuilder().
|
||||
WithConfig(cfg).
|
||||
WithConfigPath(configPath).
|
||||
WithLocalManagementPassword(localPassword).
|
||||
Build()
|
||||
if err != nil {
|
||||
log.Fatalf("failed to build proxy service: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user