反向代理(server)接口

获取server分页列表

URL: http://your_ip:port/api/server/getPage

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 获取server分页列表

Request-parameters:

ParameterTypeDescriptionRequiredSince
currentint32当前页数(从1开始)true-
limitint32每页数量(默认为10)true-
keywordsstring查询关键字true-

Request-example:

curl   -i http://your_ip:port/api/server/getPage?current=am28jh&limit=10&keywords=gmci3u

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-
└─countint64总记录数-
└─currint32起始页(从1开始)-
└─limitint32每页记录数-
└─recordsarray列表内容-
     └─idstring主键-
     └─serverNamestring监听域名-
     └─listenstring监听ip端口 (格式 ip:port或port)-
     └─defint32是否为默认server 0否(默认) 1是-
     └─rewriteint32是否http跳转https 0否(默认) 1是-
     └─rewriteListenstringhttp跳转https监听ip端口,默认为80 (格式 ip:port或port)-
     └─sslint32是否开启ssl 0否(默认) 1是-
     └─http2int32是否开启http2 0否(默认) 1是-
     └─proxyProtocolint32是否开启proxy_protocol 0否(默认) 1是-
     └─pemstringssl证书pem文件路径-
     └─keystringssl证书key文件路径-
     └─proxyTypeint32代理类型 0:http(默认) 1:tcp 2:udp-
     └─proxyUpstreamIdstring代理upstream的id-
     └─enableboolean是否启用 true:启用(默认) false:禁用-
     └─descrstring描述-
     └─protocolsstring加密协议 (默认:TLSv1 TLSv1.1 TLSv1.2 TLSv1.3)-
     └─passwordIdstring使用的password文件Id-

Response-example:

{
	"success":true,
	"status":"5apfo5",
	"msg":"yt3ai7",
	"obj":{
		"count":986,
		"curr":530,
		"limit":10,
		"records":[
			{
				"id":"45",
				"serverName":"鹤轩.白",
				"listen":"0prb73",
				"def":168,
				"rewrite":182,
				"rewriteListen":"6ggh7u",
				"ssl":735,
				"http2":539,
				"proxyProtocol":159,
				"pem":"inoiaq",
				"key":"c44lt0",
				"proxyType":323,
				"proxyUpstreamId":"45",
				"enable":true,
				"descr":"vvpe1q",
				"protocols":"zq3ak2",
				"passwordId":"45"
			}
		]
	}
}

添加或编辑server

URL: http://your_ip:port/api/server/insertOrUpdate

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 添加或编辑server

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring主键false-
serverNamestring监听域名false-
listenstring监听ip端口 (格式 ip:port或port)true-
defint32是否为默认server 0否(默认) 1是false-
rewriteint32是否http跳转https 0否(默认) 1是false-
rewriteListenstringhttp跳转https监听ip端口,默认为80 (格式 ip:port或port)false-
sslint32是否开启ssl 0否(默认) 1是false-
http2int32是否开启http2 0否(默认) 1是false-
proxyProtocolint32是否开启proxy_protocol 0否(默认) 1是false-
pemstringssl证书pem文件路径false-
keystringssl证书key文件路径false-
proxyTypeint32代理类型 0:http(默认) 1:tcp 2:udpfalse-
proxyUpstreamIdstring代理upstream的idfalse-
enableboolean是否启用 true:启用(默认) false:禁用false-
descrstring描述false-
protocolsstring加密协议 (默认:TLSv1 TLSv1.1 TLSv1.2 TLSv1.3)false-
passwordIdstring使用的password文件Idfalse-

Request-example:

curl   -i http://your_ip:port/api/server/insertOrUpdate?rewriteListen=3r7p63&key=w4l1bh&listen=09xusm&protocols=ulhmpa&proxyProtocol=948&seq=0&pem=qm42n3&descr=n6q0ov&updateTime=1641871596310&serverName=鹤轩.白&proxyType=303&pemStr=btwgd2&def=448&enable=true&proxyUpstreamId=45&id=45&passwordId=45&ssl=812&keyStr=c9535u&http2=928&createTime=1641871596310&rewrite=128

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"ibmlr3",
	"msg":"ml9q3z",
	"obj":{
		
	}
}

删除server

URL: http://your_ip:port/api/server/delete

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 删除server

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring反向代理idtrue-

Request-example:

curl   -i http://your_ip:port/api/server/delete?id=45

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"iqy47a",
	"msg":"azv4p7",
	"obj":{
		
	}
}

根据serverId获取location列表

URL: http://your_ip:port/api/server/getLocationByServerId

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 根据serverId获取location列表

Request-parameters:

ParameterTypeDescriptionRequiredSince
serverIdstring反向代理idtrue-

Request-example:

curl   -i http://your_ip:port/api/server/getLocationByServerId?serverId=45

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-
└─idstring主键-
└─serverIdstring所属反向代理serverId-
└─pathstring监控路径 例:/-
└─typeint32代理类型 0:动态代理(默认) 1:静态代理 2:负载均衡 3:空白代理-
└─valuestring动态代理目标 (例:http://10.10.10.1:8080/)-
└─upstreamTypestring代理负载协议,http or https-
└─upstreamIdstring代理负载均衡upstream的id-
└─upstreamPathstring代理负载额外路径,默认为空-
└─rootPathstring静态代理路径 (例:/home/www)-
└─rootPagestring静态代理默认页面 (例:index.html)-
└─rootTypestring静态代理类型 root:根路径模式 alias:别名模式-
└─headerint32是否携带Host参数 0否 1是(默认)-
└─websocketint32是否开启websocket支持 0否(默认) 1是-

Response-example:

{
	"success":true,
	"status":"kilgm4",
	"msg":"um1ium",
	"obj":[
		{
			"id":"45",
			"serverId":"45",
			"path":"q6c9bl",
			"type":828,
			"value":"suqxyi",
			"upstreamType":"d3i9xl",
			"upstreamId":"45",
			"upstreamPath":"l45vw3",
			"rootPath":"2hjcec",
			"rootPage":"ws27nb",
			"rootType":"5ccy8i",
			"header":241,
			"websocket":252
		}
	]
}

添加或编辑location

URL: http://your_ip:port/api/server/insertOrUpdateLocation

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 添加或编辑location

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring主键false-
serverIdstring所属反向代理serverIdtrue-
pathstring监控路径 例:/true-
typeint32代理类型 0:动态代理(默认) 1:静态代理 2:负载均衡 3:空白代理false-
valuestring动态代理目标 (例:http://10.10.10.1:8080/)false-
upstreamTypestring代理负载协议,http or httpsfalse-
upstreamIdstring代理负载均衡upstream的idfalse-
upstreamPathstring代理负载额外路径,默认为空false-
rootPathstring静态代理路径 (例:/home/www)false-
rootPagestring静态代理默认页面 (例:index.html)false-
rootTypestring静态代理类型 root:根路径模式 alias:别名模式false-
headerint32是否携带Host参数 0否 1是(默认)false-
websocketint32是否开启websocket支持 0否(默认) 1是false-

Request-example:

curl   -i http://your_ip:port/api/server/insertOrUpdateLocation?createTime=1641871596310&locationParamJson=30rgac&upstreamType=lebfju&updateTime=1641871596310&path=mgt8hc&type=21&rootPage=6mixs1&header=807&value=llfa10&upstreamId=45&rootType=46asvm&rootPath=mdejkj&websocket=224&id=45&serverId=45&upstreamPath=mqqzqf

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"tw4lux",
	"msg":"77ywvi",
	"obj":{
		
	}
}

删除location

URL: http://your_ip:port/api/server/deleteLocation

Type: ANY

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 删除location

Request-parameters:

ParameterTypeDescriptionRequiredSince
idstring代理目标location的idtrue-

Request-example:

curl   -i http://your_ip:port/api/server/deleteLocation?id=45

Response-fields:

FieldTypeDescriptionSince
successboolean请求结果-
statusstring请求状态 200:请求成功 401:token无效 500:服务器错误-
msgstring错误信息-
objobject返回内容-

Response-example:

{
	"success":true,
	"status":"z7plds",
	"msg":"rgom7n",
	"obj":{
		
	}
}