mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-29 08:02:34 +02:00
194 lines
5 KiB
JSON
194 lines
5 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "go-proxy providers file",
|
|
"anyOf": [
|
|
{
|
|
"type": "object"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"patternProperties": {
|
|
"^[a-zA-Z0-9_-]+$": {
|
|
"title": "Proxy entry",
|
|
"type": "object",
|
|
"properties": {
|
|
"scheme": {
|
|
"title": "Proxy scheme (http, https, tcp, udp)",
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"enum": [
|
|
"http",
|
|
"https",
|
|
"tcp",
|
|
"udp",
|
|
"tcp:tcp",
|
|
"udp:udp",
|
|
"tcp:udp",
|
|
"udp:tcp"
|
|
]
|
|
},
|
|
{
|
|
"type": "null",
|
|
"description": "Auto detect base on port number"
|
|
}
|
|
]
|
|
},
|
|
"host": {
|
|
"oneOf": [
|
|
{
|
|
"type": "string",
|
|
"format": "ipv4",
|
|
"description": "Proxy to ipv4 address"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"format": "ipv6",
|
|
"description": "Proxy to ipv6 address"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"format": "hostname",
|
|
"description": "Proxy to hostname"
|
|
}
|
|
],
|
|
"title": "Proxy host (ipv4 / ipv6 / hostname)"
|
|
},
|
|
"port": {
|
|
"title": "Proxy port"
|
|
},
|
|
"path": {
|
|
"title": "Proxy path pattern (See https://pkg.go.dev/net/http#ServeMux)"
|
|
},
|
|
"no_tls_verify": {
|
|
"description": "Disable TLS verification for https proxy",
|
|
"type": "boolean"
|
|
},
|
|
"set_headers": {},
|
|
"hide_headers": {}
|
|
},
|
|
"required": ["host"],
|
|
"additionalProperties": false,
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"anyOf": [
|
|
{
|
|
"properties": {
|
|
"scheme": {
|
|
"enum": ["http", "https"]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"properties": {
|
|
"scheme": {
|
|
"not": true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"properties": {
|
|
"scheme": {
|
|
"type": "null"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"port": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[0-9]{1,5}$",
|
|
"minimum": 1,
|
|
"maximum": 65535,
|
|
"markdownDescription": "Proxy port from **1** to **65535**",
|
|
"patternErrorMessage": "'port' must be a number"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 65535
|
|
}
|
|
]
|
|
},
|
|
"path": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"description": "Proxy path"
|
|
},
|
|
{
|
|
"type": "null",
|
|
"description": "No proxy path"
|
|
}
|
|
]
|
|
},
|
|
"set_headers": {
|
|
"type": "object",
|
|
"description": "Proxy headers to set",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"hide_headers": {
|
|
"type": "array",
|
|
"description": "Proxy headers to hide",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"else": {
|
|
"properties": {
|
|
"port": {
|
|
"markdownDescription": "`listening port`:`proxy port | service name`",
|
|
"type": "string",
|
|
"pattern": "^[0-9]+\\:[0-9a-z]+$",
|
|
"patternErrorMessage": "'port' must be in the format of '<listening port>:<proxy port | service name>'"
|
|
},
|
|
"path": {
|
|
"not": true
|
|
},
|
|
"set_headers": {
|
|
"not": true
|
|
},
|
|
"hide_headers": {
|
|
"not": true
|
|
}
|
|
},
|
|
"required": ["port"]
|
|
}
|
|
},
|
|
{
|
|
"if": {
|
|
"not": {
|
|
"properties": {
|
|
"scheme": {
|
|
"const": "https"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"no_tls_verify": {
|
|
"not": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
}
|