2020-09-15 14:44:38 +08:00
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
|
|
2021-01-25 16:41:30 +08:00
|
|
|
|
import "models/model_reverse_proxy.proto";
|
|
|
|
|
|
import "models/rpc_messages.proto";
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
2022-06-25 19:22:19 +08:00
|
|
|
|
// 反向代理管理服务
|
2020-09-15 14:44:38 +08:00
|
|
|
|
service ReverseProxyService {
|
|
|
|
|
|
// 创建反向代理
|
|
|
|
|
|
rpc createReverseProxy (CreateReverseProxyRequest) returns (CreateReverseProxyResponse);
|
|
|
|
|
|
|
|
|
|
|
|
// 查找反向代理
|
|
|
|
|
|
rpc findEnabledReverseProxy (FindEnabledReverseProxyRequest) returns (FindEnabledReverseProxyResponse);
|
|
|
|
|
|
|
|
|
|
|
|
// 查找反向代理配置
|
|
|
|
|
|
rpc findEnabledReverseProxyConfig (FindEnabledReverseProxyConfigRequest) returns (FindEnabledReverseProxyConfigResponse);
|
|
|
|
|
|
|
|
|
|
|
|
// 修改反向代理的调度算法
|
2020-11-13 18:23:06 +08:00
|
|
|
|
rpc updateReverseProxyScheduling (UpdateReverseProxySchedulingRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
|
|
// 修改主要源站信息
|
2020-11-13 18:23:06 +08:00
|
|
|
|
rpc updateReverseProxyPrimaryOrigins (UpdateReverseProxyPrimaryOriginsRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
|
|
// 修改备用源站信息
|
2020-11-13 18:23:06 +08:00
|
|
|
|
rpc updateReverseProxyBackupOrigins (UpdateReverseProxyBackupOriginsRequest) returns (RPCSuccess);
|
2020-09-16 09:09:31 +08:00
|
|
|
|
|
2021-01-26 20:28:46 +08:00
|
|
|
|
// 修改反向代理设置
|
2020-11-13 18:23:06 +08:00
|
|
|
|
rpc updateReverseProxy (UpdateReverseProxyRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 创建反向代理
|
|
|
|
|
|
message CreateReverseProxyRequest {
|
2023-06-17 21:05:03 +08:00
|
|
|
|
bytes schedulingJSON = 1; // 可选项,调度设置 @link json:scheduling
|
|
|
|
|
|
bytes primaryOriginsJSON = 2; // 可选项,主要源站 @link json:origin_refs
|
|
|
|
|
|
bytes backupOriginsJSON = 3; // 可选项,备用源站 @link json:origin_refs
|
2020-09-15 14:44:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message CreateReverseProxyResponse {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查找反向代理
|
|
|
|
|
|
message FindEnabledReverseProxyRequest {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message FindEnabledReverseProxyResponse {
|
|
|
|
|
|
ReverseProxy reverseProxy = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查找反向代理配置
|
|
|
|
|
|
message FindEnabledReverseProxyConfigRequest {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message FindEnabledReverseProxyConfigResponse {
|
2020-09-21 19:52:10 +08:00
|
|
|
|
bytes reverseProxyJSON = 1;
|
2020-09-15 14:44:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 修改反向代理调度算法
|
|
|
|
|
|
message UpdateReverseProxySchedulingRequest {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
bytes schedulingJSON = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 修改主要源站信息
|
|
|
|
|
|
message UpdateReverseProxyPrimaryOriginsRequest {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
bytes originsJSON = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 修改备用源站信息
|
|
|
|
|
|
message UpdateReverseProxyBackupOriginsRequest {
|
|
|
|
|
|
int64 reverseProxyId = 1;
|
|
|
|
|
|
bytes originsJSON = 2;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-01-26 20:28:46 +08:00
|
|
|
|
// 修改反向代理设置
|
2020-09-27 10:03:24 +08:00
|
|
|
|
message UpdateReverseProxyRequest {
|
2023-08-20 15:49:49 +08:00
|
|
|
|
int64 reverseProxyId = 1; // 反向代理ID
|
|
|
|
|
|
int32 requestHostType = 6; // 可选参数,回源主机名类型:0 跟随CDN域名,1跟随源站,2自定义
|
|
|
|
|
|
string requestHost = 2; // 可选参数,自定义回源主机名
|
|
|
|
|
|
bool requestHostExcludingPort = 15; // 可选参数,回源主机名中去除端口
|
|
|
|
|
|
string requestURI = 3; // 可选参数,请求URI
|
|
|
|
|
|
string stripPrefix = 4; // 可选参数,去除URI前缀
|
|
|
|
|
|
bool autoFlush = 5; // 可选参数,自动刷新
|
|
|
|
|
|
repeated string addHeaders = 7; // 可选参数,可以添加的请求报头
|
|
|
|
|
|
bytes connTimeoutJSON = 8; // 可选参数,连接超时时间
|
|
|
|
|
|
bytes readTimeoutJSON = 9; // 可选参数,读取超时时间
|
|
|
|
|
|
bytes idleTimeoutJSON = 10; // 可选参数,空闲连接超时时间
|
|
|
|
|
|
int32 maxConns = 11; // 可选参数,最大连接数
|
|
|
|
|
|
int32 maxIdleConns = 12; // 可选参数,最大空闲连接数
|
|
|
|
|
|
bytes proxyProtocolJSON = 13; // 可选参数,PROXY Protocol设置
|
|
|
|
|
|
bool followRedirects = 14; // 可选参数,跳转跟随
|
|
|
|
|
|
bool retry50X = 16; // 可选参数,启用50X重试
|
2020-09-15 14:44:38 +08:00
|
|
|
|
}
|