612d68f56f
Go + Vue 管理台,SQLite 持久化;支持隧道/域名穿透、域名转发插件链、访客认证、 IP 规则、API Key、Docker 单镜像部署;配置通过 Web 系统设置管理,无需 YAML 文件。 Co-authored-by: Cursor <cursoragent@cursor.com>
65 lines
1.7 KiB
Go
65 lines
1.7 KiB
Go
package forwardplugin
|
||
|
||
type PluginTypeMeta struct {
|
||
Type string `json:"type"`
|
||
Label string `json:"label"`
|
||
Description string `json:"description"`
|
||
ConfigSchema interface{} `json:"config_schema"`
|
||
DefaultConfig interface{} `json:"default_config"`
|
||
}
|
||
|
||
func ListPluginTypes() []PluginTypeMeta {
|
||
return []PluginTypeMeta{
|
||
{
|
||
Type: "sub_filter",
|
||
Label: "内容替换",
|
||
Description: "按 MIME 类型对响应体做字符串替换",
|
||
ConfigSchema: map[string]interface{}{
|
||
"filters": []map[string]string{{"from": "", "to": ""}},
|
||
"types": []string{"text/html"},
|
||
},
|
||
DefaultConfig: map[string]interface{}{
|
||
"filters": []map[string]string{{"from": "", "to": ""}},
|
||
"types": []string{"text/html"},
|
||
},
|
||
},
|
||
{
|
||
Type: "inject_js",
|
||
Label: "JS 注入",
|
||
Description: "在 HTML </body> 前注入脚本",
|
||
ConfigSchema: map[string]interface{}{
|
||
"script": "",
|
||
},
|
||
DefaultConfig: map[string]interface{}{
|
||
"script": "<script></script>",
|
||
},
|
||
},
|
||
{
|
||
Type: "cookie_domain",
|
||
Label: "Cookie 域改写",
|
||
Description: "改写 Set-Cookie 的 Domain 属性",
|
||
ConfigSchema: map[string]interface{}{
|
||
"from": "",
|
||
"to": "",
|
||
},
|
||
DefaultConfig: map[string]interface{}{
|
||
"from": ".example.com",
|
||
"to": ".proxy.com",
|
||
},
|
||
},
|
||
{
|
||
Type: "response_cache",
|
||
Label: "GET 响应缓存",
|
||
Description: "缓存上游原始 GET 响应(不含 Set-Cookie)",
|
||
ConfigSchema: map[string]interface{}{
|
||
"max_mb": 0,
|
||
"ttl_sec": 300,
|
||
},
|
||
DefaultConfig: map[string]interface{}{
|
||
"max_mb": 50,
|
||
"ttl_sec": 300,
|
||
},
|
||
},
|
||
}
|
||
}
|