mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	删除一直未实现的Unix协议相关内容
This commit is contained in:
		@@ -10708,17 +10708,6 @@
 | 
			
		||||
          ],
 | 
			
		||||
          "isDeprecated": false
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "name": "updateServerUnix",
 | 
			
		||||
          "requestMessageName": "UpdateServerUnixRequest",
 | 
			
		||||
          "responseMessageName": "RPCSuccess",
 | 
			
		||||
          "code": "rpc updateServerUnix (UpdateServerUnixRequest) returns (RPCSuccess);",
 | 
			
		||||
          "doc": "修改网站的Unix设置",
 | 
			
		||||
          "roles": [
 | 
			
		||||
            "admin"
 | 
			
		||||
          ],
 | 
			
		||||
          "isDeprecated": false
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "name": "updateServerUDP",
 | 
			
		||||
          "requestMessageName": "UpdateServerUDPRequest",
 | 
			
		||||
@@ -16067,7 +16056,7 @@
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "CreateServerRequest",
 | 
			
		||||
      "code": "message CreateServerRequest {\n\tint64 userId = 1; // 可选项,用户ID,如果不想指定用户,此值可以为0\n\tint64 adminId = 2; // 可选项,管理员ID\n\tstring type = 3; // 类型:httpProxy(HTTP反向代理,一般CDN服务都选这个)、httpWeb(静态文件服务,只会从服务器上读取文件内容,不会转发到源站)、tcpProxy(TCP反向代理)、udpProxy(UDP反向代理)\n\tstring name = 4; // 网站名称,通常可以是一个域名\n\tstring description = 5; // 可选项,网站描述\n\n\t// 配置相关\n\tbytes serverNamesJSON = 8; // 域名列表 @link json:server_names\n\tbytes serverNamesJON = 19 [deprecated = true]; // 已过期,请使用 serverNamesJSON 代替\n\tbytes httpJSON = 9; // HTTP协议设置,当type为httpProxy或者httpWeb时填写 @link json:http_protocol\n\tbytes httpsJSON = 10;  // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 @link json:https_protocol\n\tbytes tcpJSON = 11;  // TCP协议设置,当type为tcpProxy时填写 @link json:tcp_protocol\n\tbytes tlsJSON = 12;  // TLS协议设置,当type为tcpProxy时填写 @link json:tls_protocol\n\tbytes unixJSON = 13; // 备用参数,不用填写\n\tbytes udpJSON = 14; // UDP协议设置,当type为udpProxy时填写 @link json:udp_protocol\n\tint64 webId = 15; // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作\n\tbytes reverseProxyJSON = 16; // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 @link json:reverse_proxy_ref\n\trepeated int64 serverGroupIds = 17; // 可选项,所属网站分组ID列表\n\tint64 userPlanId = 18; // 可选项,套餐ID\n\n\tint64 nodeClusterId = 30; // 所部署的集群ID\n\tbytes includeNodesJSON = 31; // 备用参数,不用填写\n\tbytes excludeNodesJSON = 32; // 备用参数,不用填写\n}",
 | 
			
		||||
      "code": "message CreateServerRequest {\n\tint64 userId = 1; // 可选项,用户ID,如果不想指定用户,此值可以为0\n\tint64 adminId = 2; // 可选项,管理员ID\n\tstring type = 3; // 类型:httpProxy(HTTP反向代理,一般CDN服务都选这个)、httpWeb(静态文件服务,只会从服务器上读取文件内容,不会转发到源站)、tcpProxy(TCP反向代理)、udpProxy(UDP反向代理)\n\tstring name = 4; // 网站名称,通常可以是一个域名\n\tstring description = 5; // 可选项,网站描述\n\n\t// 配置相关\n\tbytes serverNamesJSON = 8; // 域名列表 @link json:server_names\n\tbytes serverNamesJON = 19 [deprecated = true]; // 已过期,请使用 serverNamesJSON 代替\n\tbytes httpJSON = 9; // HTTP协议设置,当type为httpProxy或者httpWeb时填写 @link json:http_protocol\n\tbytes httpsJSON = 10;  // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 @link json:https_protocol\n\tbytes tcpJSON = 11;  // TCP协议设置,当type为tcpProxy时填写 @link json:tcp_protocol\n\tbytes tlsJSON = 12;  // TLS协议设置,当type为tcpProxy时填写 @link json:tls_protocol\n\tbytes udpJSON = 14; // UDP协议设置,当type为udpProxy时填写 @link json:udp_protocol\n\tint64 webId = 15; // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作\n\tbytes reverseProxyJSON = 16; // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 @link json:reverse_proxy_ref\n\trepeated int64 serverGroupIds = 17; // 可选项,所属网站分组ID列表\n\tint64 userPlanId = 18; // 可选项,套餐ID\n\n\tint64 nodeClusterId = 30; // 所部署的集群ID\n\tbytes includeNodesJSON = 31; // 备用参数,不用填写\n\tbytes excludeNodesJSON = 32; // 备用参数,不用填写\n}",
 | 
			
		||||
      "doc": "创建网站"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
@@ -22122,7 +22111,7 @@
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "Server",
 | 
			
		||||
      "code": "message Server {\n\tint64 id = 1;\n\tbool isOn = 18;\n\tstring type = 2;\n\tstring name = 3;\n\tstring description = 4;\n\tbytes includeNodes = 5;\n\tbytes excludeNodes = 6;\n\tint64 createdAt = 7;\n\tstring dnsName = 19;\n\tbool supportCNAME = 23;\n\tint64 userPlanId = 24;\n\tint64 userId = 29; // 所属用户ID\n\n\t// 配置相关\n\tbytes config = 17;\n\tbytes serverNamesJSON = 8;\n\tstring firstServerName = 33;\n\tint32 countServerNames = 28;\n\tbool isAuditing = 20;\n\tint64 auditingAt = 25;\n\tbytes auditingServerNamesJSON = 21;\n\tServerNameAuditingResult auditingResult = 22;\n\n\tbytes httpJSON = 9;\n\tbytes httpsJSON = 10;\n\tbytes tcpJSON = 11;\n\tbytes tlsJSON = 12;\n\tbytes unixJSON = 13;\n\tbytes udpJSON = 14;\n\tint64 webId = 15;\n\tbytes reverseProxyJSON = 16;\n\n\tstring bandwidthTime = 26; // 带宽时间\n\tint64 bandwidthBytes = 27; // 带宽字节数\n\tint64 countRequests = 34; // 最近(通常5分钟内)访问量\n\tint64 countAttackRequests = 35; // 最近识别到的攻击访问量\n\n\tNodeCluster nodeCluster = 30;\n\trepeated ServerGroup serverGroups = 31;\n\tUser user = 32;\n}",
 | 
			
		||||
      "code": "message Server {\n\tint64 id = 1;\n\tbool isOn = 18;\n\tstring type = 2;\n\tstring name = 3;\n\tstring description = 4;\n\tbytes includeNodes = 5;\n\tbytes excludeNodes = 6;\n\tint64 createdAt = 7;\n\tstring dnsName = 19;\n\tbool supportCNAME = 23;\n\tint64 userPlanId = 24;\n\tint64 userId = 29; // 所属用户ID\n\n\t// 配置相关\n\tbytes config = 17;\n\tbytes serverNamesJSON = 8;\n\tstring firstServerName = 33;\n\tint32 countServerNames = 28;\n\tbool isAuditing = 20;\n\tint64 auditingAt = 25;\n\tbytes auditingServerNamesJSON = 21;\n\tServerNameAuditingResult auditingResult = 22;\n\n\tbytes httpJSON = 9;\n\tbytes httpsJSON = 10;\n\tbytes tcpJSON = 11;\n\tbytes tlsJSON = 12;\n\tbytes udpJSON = 14;\n\tint64 webId = 15;\n\tbytes reverseProxyJSON = 16;\n\n\tstring bandwidthTime = 26; // 带宽时间\n\tint64 bandwidthBytes = 27; // 带宽字节数\n\tint64 countRequests = 34; // 最近(通常5分钟内)访问量\n\tint64 countAttackRequests = 35; // 最近识别到的攻击访问量\n\n\tNodeCluster nodeCluster = 30;\n\trepeated ServerGroup serverGroups = 31;\n\tUser user = 32;\n}",
 | 
			
		||||
      "doc": ""
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
@@ -23480,11 +23469,6 @@
 | 
			
		||||
      "code": "message UpdateServerUDPRequest {\n\tint64 serverId = 1; // 网站ID\n\tbytes udpJSON = 2; // UDP协议设置,当type为udpProxy时填写 @link json:udp_protocol\n}",
 | 
			
		||||
      "doc": ""
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "UpdateServerUnixRequest",
 | 
			
		||||
      "code": "message UpdateServerUnixRequest {\n\tint64 serverId = 1; // 网站ID\n\tbytes unixJSON = 2;\n}",
 | 
			
		||||
      "doc": ""
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "UpdateServerUserPlanRequest",
 | 
			
		||||
      "code": "message UpdateServerUserPlanRequest {\n\tint64 serverId = 1; // 网站ID\n\tint64 userPlanId = 2;\n}",
 | 
			
		||||
 
 | 
			
		||||
@@ -544,7 +544,6 @@ const (
 | 
			
		||||
	Server_MenuSettingUAM                                       langs.MessageCode = "server@menu_setting_uam"                                             // 5秒盾
 | 
			
		||||
	Server_MenuSettingUDP                                       langs.MessageCode = "server@menu_setting_udp"                                             // UDP
 | 
			
		||||
	Server_MenuSettingUDPProxy                                  langs.MessageCode = "server@menu_setting_udp_proxy"                                       // UDP代理
 | 
			
		||||
	Server_MenuSettingUnix                                      langs.MessageCode = "server@menu_setting_unix"                                            // Unix
 | 
			
		||||
	Server_MenuSettingUserAgents                                langs.MessageCode = "server@menu_setting_user_agents"                                     // UA名单
 | 
			
		||||
	Server_MenuSettingWAF                                       langs.MessageCode = "server@menu_setting_waf"                                             // WAF
 | 
			
		||||
	Server_MenuSettingWebP                                      langs.MessageCode = "server@menu_setting_webp"                                            // WebP
 | 
			
		||||
 
 | 
			
		||||
@@ -545,7 +545,6 @@ func init() {
 | 
			
		||||
		"server@menu_setting_uam":                                             "UAM",
 | 
			
		||||
		"server@menu_setting_udp":                                             "UDP",
 | 
			
		||||
		"server@menu_setting_udp_proxy":                                       "UDP Reverse Proxy",
 | 
			
		||||
		"server@menu_setting_unix":                                            "Unix",
 | 
			
		||||
		"server@menu_setting_user_agents":                                     "UA List",
 | 
			
		||||
		"server@menu_setting_waf":                                             "WAF",
 | 
			
		||||
		"server@menu_setting_webp":                                            "WebP",
 | 
			
		||||
 
 | 
			
		||||
@@ -545,7 +545,6 @@ func init() {
 | 
			
		||||
		"server@menu_setting_uam":                                             "5秒盾",
 | 
			
		||||
		"server@menu_setting_udp":                                             "UDP",
 | 
			
		||||
		"server@menu_setting_udp_proxy":                                       "UDP代理",
 | 
			
		||||
		"server@menu_setting_unix":                                            "Unix",
 | 
			
		||||
		"server@menu_setting_user_agents":                                     "UA名单",
 | 
			
		||||
		"server@menu_setting_waf":                                             "WAF",
 | 
			
		||||
		"server@menu_setting_webp":                                            "WebP",
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
  "menu_setting_others": "Others",
 | 
			
		||||
  "menu_setting_tcp": "TCP",
 | 
			
		||||
  "menu_setting_tls": "TLS",
 | 
			
		||||
  "menu_setting_unix": "Unix",
 | 
			
		||||
  "menu_setting_udp": "UDP",
 | 
			
		||||
  "menu_setting_delete": "Delete",
 | 
			
		||||
  "menu_setting_http_proxy": "HTTP Reverse Proxy", // in site groups
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
  "menu_setting_others": "其他设置",
 | 
			
		||||
  "menu_setting_tcp": "TCP",
 | 
			
		||||
  "menu_setting_tls": "TLS",
 | 
			
		||||
  "menu_setting_unix": "Unix",
 | 
			
		||||
  "menu_setting_udp": "UDP",
 | 
			
		||||
  "menu_setting_delete": "删除",
 | 
			
		||||
  "menu_setting_http_proxy": "HTTP代理", // 网站分组中使用
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,6 @@ type Server struct {
 | 
			
		||||
	HttpsJSON               []byte                    `protobuf:"bytes,10,opt,name=httpsJSON,proto3" json:"httpsJSON,omitempty"`
 | 
			
		||||
	TcpJSON                 []byte                    `protobuf:"bytes,11,opt,name=tcpJSON,proto3" json:"tcpJSON,omitempty"`
 | 
			
		||||
	TlsJSON                 []byte                    `protobuf:"bytes,12,opt,name=tlsJSON,proto3" json:"tlsJSON,omitempty"`
 | 
			
		||||
	UnixJSON                []byte                    `protobuf:"bytes,13,opt,name=unixJSON,proto3" json:"unixJSON,omitempty"`
 | 
			
		||||
	UdpJSON                 []byte                    `protobuf:"bytes,14,opt,name=udpJSON,proto3" json:"udpJSON,omitempty"`
 | 
			
		||||
	WebId                   int64                     `protobuf:"varint,15,opt,name=webId,proto3" json:"webId,omitempty"`
 | 
			
		||||
	ReverseProxyJSON        []byte                    `protobuf:"bytes,16,opt,name=reverseProxyJSON,proto3" json:"reverseProxyJSON,omitempty"`
 | 
			
		||||
@@ -263,13 +262,6 @@ func (x *Server) GetTlsJSON() []byte {
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *Server) GetUnixJSON() []byte {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.UnixJSON
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (x *Server) GetUdpJSON() []byte {
 | 
			
		||||
	if x != nil {
 | 
			
		||||
		return x.UdpJSON
 | 
			
		||||
@@ -353,7 +345,7 @@ var file_models_model_server_proto_rawDesc = []byte{
 | 
			
		||||
	0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x6d, 0x6f, 0x64, 0x65,
 | 
			
		||||
	0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f,
 | 
			
		||||
	0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65,
 | 
			
		||||
	0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x09, 0x0a, 0x06, 0x53,
 | 
			
		||||
	0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x09, 0x0a, 0x06, 0x53,
 | 
			
		||||
	0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
 | 
			
		||||
	0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x12, 0x20,
 | 
			
		||||
	0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
 | 
			
		||||
@@ -403,34 +395,32 @@ var file_models_model_server_proto_rawDesc = []byte{
 | 
			
		||||
	0x4e, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x63, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0b, 0x20, 0x01,
 | 
			
		||||
	0x28, 0x0c, 0x52, 0x07, 0x74, 0x63, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x74,
 | 
			
		||||
	0x6c, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x74, 0x6c,
 | 
			
		||||
	0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x78, 0x4a, 0x53, 0x4f,
 | 
			
		||||
	0x4e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x78, 0x4a, 0x53, 0x4f,
 | 
			
		||||
	0x4e, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0e, 0x20, 0x01,
 | 
			
		||||
	0x28, 0x0c, 0x52, 0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x77,
 | 
			
		||||
	0x65, 0x62, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x77, 0x65, 0x62, 0x49,
 | 
			
		||||
	0x64, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78,
 | 
			
		||||
	0x79, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x76,
 | 
			
		||||
	0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x24, 0x0a,
 | 
			
		||||
	0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x1a,
 | 
			
		||||
	0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x54,
 | 
			
		||||
	0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68,
 | 
			
		||||
	0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x61, 0x6e,
 | 
			
		||||
	0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63,
 | 
			
		||||
	0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x22, 0x20, 0x01,
 | 
			
		||||
	0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
 | 
			
		||||
	0x73, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b,
 | 
			
		||||
	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13,
 | 
			
		||||
	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65,
 | 
			
		||||
	0x73, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74,
 | 
			
		||||
	0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f,
 | 
			
		||||
	0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43,
 | 
			
		||||
	0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
 | 
			
		||||
	0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70,
 | 
			
		||||
	0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0c, 0x73,
 | 
			
		||||
	0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x1c, 0x0a, 0x04, 0x75,
 | 
			
		||||
	0x73, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55,
 | 
			
		||||
	0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70,
 | 
			
		||||
	0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 | 
			
		||||
	0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e,
 | 
			
		||||
	0x18, 0x0e, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x75, 0x64, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12,
 | 
			
		||||
	0x14, 0x0a, 0x05, 0x77, 0x65, 0x62, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
 | 
			
		||||
	0x77, 0x65, 0x62, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65,
 | 
			
		||||
	0x50, 0x72, 0x6f, 0x78, 0x79, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0c, 0x52,
 | 
			
		||||
	0x10, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4a, 0x53, 0x4f,
 | 
			
		||||
	0x4e, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x54, 0x69,
 | 
			
		||||
	0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69,
 | 
			
		||||
	0x64, 0x74, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x61, 0x6e, 0x64, 0x77,
 | 
			
		||||
	0x69, 0x64, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x03, 0x52,
 | 
			
		||||
	0x0e, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12,
 | 
			
		||||
	0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73,
 | 
			
		||||
	0x18, 0x22, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71,
 | 
			
		||||
	0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74,
 | 
			
		||||
	0x74, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x23, 0x20, 0x01,
 | 
			
		||||
	0x28, 0x03, 0x52, 0x13, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x6b, 0x52,
 | 
			
		||||
	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x43,
 | 
			
		||||
	0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70,
 | 
			
		||||
	0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x6e,
 | 
			
		||||
	0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x0c, 0x73, 0x65,
 | 
			
		||||
	0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x1f, 0x20, 0x03, 0x28, 0x0b,
 | 
			
		||||
	0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,
 | 
			
		||||
	0x70, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12,
 | 
			
		||||
	0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e,
 | 
			
		||||
	0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x06, 0x5a,
 | 
			
		||||
	0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -31,7 +31,6 @@ const (
 | 
			
		||||
	ServerService_UpdateServerHTTPS_FullMethodName                         = "/pb.ServerService/updateServerHTTPS"
 | 
			
		||||
	ServerService_UpdateServerTCP_FullMethodName                           = "/pb.ServerService/updateServerTCP"
 | 
			
		||||
	ServerService_UpdateServerTLS_FullMethodName                           = "/pb.ServerService/updateServerTLS"
 | 
			
		||||
	ServerService_UpdateServerUnix_FullMethodName                          = "/pb.ServerService/updateServerUnix"
 | 
			
		||||
	ServerService_UpdateServerUDP_FullMethodName                           = "/pb.ServerService/updateServerUDP"
 | 
			
		||||
	ServerService_UpdateServerWeb_FullMethodName                           = "/pb.ServerService/updateServerWeb"
 | 
			
		||||
	ServerService_UpdateServerReverseProxy_FullMethodName                  = "/pb.ServerService/updateServerReverseProxy"
 | 
			
		||||
@@ -114,8 +113,6 @@ type ServerServiceClient interface {
 | 
			
		||||
	UpdateServerTCP(ctx context.Context, in *UpdateServerTCPRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的TLS设置
 | 
			
		||||
	UpdateServerTLS(ctx context.Context, in *UpdateServerTLSRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的Unix设置
 | 
			
		||||
	UpdateServerUnix(ctx context.Context, in *UpdateServerUnixRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的UDP设置
 | 
			
		||||
	UpdateServerUDP(ctx context.Context, in *UpdateServerUDPRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的Web设置
 | 
			
		||||
@@ -338,15 +335,6 @@ func (c *serverServiceClient) UpdateServerTLS(ctx context.Context, in *UpdateSer
 | 
			
		||||
	return out, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *serverServiceClient) UpdateServerUnix(ctx context.Context, in *UpdateServerUnixRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
 | 
			
		||||
	out := new(RPCSuccess)
 | 
			
		||||
	err := c.cc.Invoke(ctx, ServerService_UpdateServerUnix_FullMethodName, in, out, opts...)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	return out, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *serverServiceClient) UpdateServerUDP(ctx context.Context, in *UpdateServerUDPRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
 | 
			
		||||
	out := new(RPCSuccess)
 | 
			
		||||
	err := c.cc.Invoke(ctx, ServerService_UpdateServerUDP_FullMethodName, in, out, opts...)
 | 
			
		||||
@@ -843,8 +831,6 @@ type ServerServiceServer interface {
 | 
			
		||||
	UpdateServerTCP(context.Context, *UpdateServerTCPRequest) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的TLS设置
 | 
			
		||||
	UpdateServerTLS(context.Context, *UpdateServerTLSRequest) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的Unix设置
 | 
			
		||||
	UpdateServerUnix(context.Context, *UpdateServerUnixRequest) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的UDP设置
 | 
			
		||||
	UpdateServerUDP(context.Context, *UpdateServerUDPRequest) (*RPCSuccess, error)
 | 
			
		||||
	// 修改网站的Web设置
 | 
			
		||||
@@ -991,9 +977,6 @@ func (UnimplementedServerServiceServer) UpdateServerTCP(context.Context, *Update
 | 
			
		||||
func (UnimplementedServerServiceServer) UpdateServerTLS(context.Context, *UpdateServerTLSRequest) (*RPCSuccess, error) {
 | 
			
		||||
	return nil, status.Errorf(codes.Unimplemented, "method UpdateServerTLS not implemented")
 | 
			
		||||
}
 | 
			
		||||
func (UnimplementedServerServiceServer) UpdateServerUnix(context.Context, *UpdateServerUnixRequest) (*RPCSuccess, error) {
 | 
			
		||||
	return nil, status.Errorf(codes.Unimplemented, "method UpdateServerUnix not implemented")
 | 
			
		||||
}
 | 
			
		||||
func (UnimplementedServerServiceServer) UpdateServerUDP(context.Context, *UpdateServerUDPRequest) (*RPCSuccess, error) {
 | 
			
		||||
	return nil, status.Errorf(codes.Unimplemented, "method UpdateServerUDP not implemented")
 | 
			
		||||
}
 | 
			
		||||
@@ -1378,24 +1361,6 @@ func _ServerService_UpdateServerTLS_Handler(srv interface{}, ctx context.Context
 | 
			
		||||
	return interceptor(ctx, in, info, handler)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func _ServerService_UpdateServerUnix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
			
		||||
	in := new(UpdateServerUnixRequest)
 | 
			
		||||
	if err := dec(in); err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	if interceptor == nil {
 | 
			
		||||
		return srv.(ServerServiceServer).UpdateServerUnix(ctx, in)
 | 
			
		||||
	}
 | 
			
		||||
	info := &grpc.UnaryServerInfo{
 | 
			
		||||
		Server:     srv,
 | 
			
		||||
		FullMethod: ServerService_UpdateServerUnix_FullMethodName,
 | 
			
		||||
	}
 | 
			
		||||
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
			
		||||
		return srv.(ServerServiceServer).UpdateServerUnix(ctx, req.(*UpdateServerUnixRequest))
 | 
			
		||||
	}
 | 
			
		||||
	return interceptor(ctx, in, info, handler)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func _ServerService_UpdateServerUDP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
			
		||||
	in := new(UpdateServerUDPRequest)
 | 
			
		||||
	if err := dec(in); err != nil {
 | 
			
		||||
@@ -2387,10 +2352,6 @@ var ServerService_ServiceDesc = grpc.ServiceDesc{
 | 
			
		||||
			MethodName: "updateServerTLS",
 | 
			
		||||
			Handler:    _ServerService_UpdateServerTLS_Handler,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			MethodName: "updateServerUnix",
 | 
			
		||||
			Handler:    _ServerService_UpdateServerUnix_Handler,
 | 
			
		||||
		},
 | 
			
		||||
		{
 | 
			
		||||
			MethodName: "updateServerUDP",
 | 
			
		||||
			Handler:    _ServerService_UpdateServerUDP_Handler,
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,6 @@ message Server {
 | 
			
		||||
	bytes httpsJSON = 10;
 | 
			
		||||
	bytes tcpJSON = 11;
 | 
			
		||||
	bytes tlsJSON = 12;
 | 
			
		||||
	bytes unixJSON = 13;
 | 
			
		||||
	bytes udpJSON = 14;
 | 
			
		||||
	int64 webId = 15;
 | 
			
		||||
	bytes reverseProxyJSON = 16;
 | 
			
		||||
 
 | 
			
		||||
@@ -47,9 +47,6 @@ service ServerService {
 | 
			
		||||
	// 修改网站的TLS设置
 | 
			
		||||
	rpc updateServerTLS (UpdateServerTLSRequest) returns (RPCSuccess);
 | 
			
		||||
 | 
			
		||||
	// 修改网站的Unix设置
 | 
			
		||||
	rpc updateServerUnix (UpdateServerUnixRequest) returns (RPCSuccess);
 | 
			
		||||
 | 
			
		||||
	// 修改网站的UDP设置
 | 
			
		||||
	rpc updateServerUDP (UpdateServerUDPRequest) returns (RPCSuccess);
 | 
			
		||||
 | 
			
		||||
@@ -222,7 +219,6 @@ message CreateServerRequest {
 | 
			
		||||
	bytes httpsJSON = 10;  // HTTPS协议设置,当type为httpProxy或者httpWeb时填写 @link json:https_protocol
 | 
			
		||||
	bytes tcpJSON = 11;  // TCP协议设置,当type为tcpProxy时填写 @link json:tcp_protocol
 | 
			
		||||
	bytes tlsJSON = 12;  // TLS协议设置,当type为tcpProxy时填写 @link json:tls_protocol
 | 
			
		||||
	bytes unixJSON = 13; // 备用参数,不用填写
 | 
			
		||||
	bytes udpJSON = 14; // UDP协议设置,当type为udpProxy时填写 @link json:udp_protocol
 | 
			
		||||
	int64 webId = 15; // 可选项,Web配置ID,当type为httpProxy或者httpWeb时填写,可以通过 /HTTPWebService/createHTTPWeb 接口创建;如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作
 | 
			
		||||
	bytes reverseProxyJSON = 16; // 反向代理(包含源站)配置引用,此项可以在创建网站后再设置 @link json:reverse_proxy_ref
 | 
			
		||||
@@ -324,11 +320,6 @@ message UpdateServerTLSRequest {
 | 
			
		||||
	bytes tlsJSON = 2; // TLS协议设置,当type为tcpProxy时填写 @link json:tls_protocol
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
message UpdateServerUnixRequest {
 | 
			
		||||
	int64 serverId = 1; // 网站ID
 | 
			
		||||
	bytes unixJSON = 2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
message UpdateServerUDPRequest {
 | 
			
		||||
	int64 serverId = 1; // 网站ID
 | 
			
		||||
	bytes udpJSON = 2; // UDP协议设置,当type为udpProxy时填写 @link json:udp_protocol
 | 
			
		||||
 
 | 
			
		||||
@@ -73,10 +73,6 @@ func (this *NetworkAddressConfig) Init() error {
 | 
			
		||||
 | 
			
		||||
// Addresses 所有的地址列表,不包括scheme
 | 
			
		||||
func (this *NetworkAddressConfig) Addresses() []string {
 | 
			
		||||
	if this.Protocol == ProtocolUnix {
 | 
			
		||||
		return []string{this.Host}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	result := []string{}
 | 
			
		||||
	for i := this.MinPort; i <= this.MaxPort; i++ {
 | 
			
		||||
		host := this.Host
 | 
			
		||||
@@ -87,10 +83,6 @@ func (this *NetworkAddressConfig) Addresses() []string {
 | 
			
		||||
 | 
			
		||||
// FullAddresses 所有的地址列表,包含scheme
 | 
			
		||||
func (this *NetworkAddressConfig) FullAddresses() []string {
 | 
			
		||||
	if this.Protocol == ProtocolUnix {
 | 
			
		||||
		return []string{this.Protocol.String() + ":" + this.Host}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	result := []string{}
 | 
			
		||||
	for i := this.MinPort; i <= this.MaxPort; i++ {
 | 
			
		||||
		host := this.Host
 | 
			
		||||
 
 | 
			
		||||
@@ -9,10 +9,10 @@ const (
 | 
			
		||||
	ProtocolHTTPS Protocol = "https"
 | 
			
		||||
	ProtocolTCP   Protocol = "tcp"
 | 
			
		||||
	ProtocolTLS   Protocol = "tls"
 | 
			
		||||
	ProtocolUnix  Protocol = "unix"
 | 
			
		||||
	ProtocolUDP   Protocol = "udp"
 | 
			
		||||
 | 
			
		||||
	// 子协议
 | 
			
		||||
 | 
			
		||||
	ProtocolHTTP4 Protocol = "http4"
 | 
			
		||||
	ProtocolHTTP6 Protocol = "http6"
 | 
			
		||||
 | 
			
		||||
@@ -27,7 +27,7 @@ const (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func AllProtocols() []Protocol {
 | 
			
		||||
	return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolTCP, ProtocolTLS, ProtocolUnix, ProtocolUDP, ProtocolHTTP4, ProtocolHTTP6, ProtocolHTTPS4, ProtocolHTTPS6, ProtocolTCP4, ProtocolTCP6, ProtocolTLS4, ProtocolTLS6}
 | 
			
		||||
	return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolTCP, ProtocolTLS, ProtocolUDP, ProtocolHTTP4, ProtocolHTTP6, ProtocolHTTPS4, ProtocolHTTPS6, ProtocolTCP4, ProtocolTCP6, ProtocolTLS4, ProtocolTLS6}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this Protocol) IsHTTPFamily() bool {
 | 
			
		||||
@@ -46,10 +46,6 @@ func (this Protocol) IsTLSFamily() bool {
 | 
			
		||||
	return this == ProtocolTLS || this == ProtocolTLS4 || this == ProtocolTLS6
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this Protocol) IsUnixFamily() bool {
 | 
			
		||||
	return this == ProtocolUnix
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this Protocol) IsUDPFamily() bool {
 | 
			
		||||
	return this == ProtocolUDP
 | 
			
		||||
}
 | 
			
		||||
@@ -69,8 +65,6 @@ func (this Protocol) Primary() Protocol {
 | 
			
		||||
		return ProtocolTCP
 | 
			
		||||
	case ProtocolTLS, ProtocolTLS4, ProtocolTLS6:
 | 
			
		||||
		return ProtocolTLS
 | 
			
		||||
	case ProtocolUnix:
 | 
			
		||||
		return ProtocolUnix
 | 
			
		||||
	case ProtocolUDP:
 | 
			
		||||
		return ProtocolUDP
 | 
			
		||||
	default:
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,5 @@ func TestProtocol_IsHTTPFamily(t *testing.T) {
 | 
			
		||||
	a.IsTrue(ProtocolTCP.IsTCPFamily())
 | 
			
		||||
	a.IsTrue(ProtocolTCP.IsTCPFamily())
 | 
			
		||||
	a.IsTrue(ProtocolTCP6.IsTCPFamily())
 | 
			
		||||
	a.IsTrue(ProtocolUnix.IsUnixFamily())
 | 
			
		||||
	a.IsTrue(ProtocolUDP.IsUDPFamily())
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
package serverconfigs
 | 
			
		||||
 | 
			
		||||
import "encoding/json"
 | 
			
		||||
 | 
			
		||||
type UnixProtocolConfig struct {
 | 
			
		||||
	BaseProtocol `yaml:",inline"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *UnixProtocolConfig) Init() error {
 | 
			
		||||
	err := this.InitBase()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 转换为JSON
 | 
			
		||||
func (this *UnixProtocolConfig) AsJSON() ([]byte, error) {
 | 
			
		||||
	return json.Marshal(this)
 | 
			
		||||
}
 | 
			
		||||
@@ -86,9 +86,6 @@ func (this *ServerAddressGroup) Protocol() Protocol {
 | 
			
		||||
// Addr 获取当前分组的地址
 | 
			
		||||
func (this *ServerAddressGroup) Addr() string {
 | 
			
		||||
	protocol := this.Protocol()
 | 
			
		||||
	if protocol == ProtocolUnix {
 | 
			
		||||
		return strings.TrimPrefix(this.fullAddr, protocol.String()+":")
 | 
			
		||||
	}
 | 
			
		||||
	return strings.TrimPrefix(this.fullAddr, protocol.String()+"://")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -121,12 +118,6 @@ func (this *ServerAddressGroup) IsTLS() bool {
 | 
			
		||||
	return p == ProtocolTLS || p == ProtocolTLS4 || p == ProtocolTLS6
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsUnix 判断当前分组是否为Unix
 | 
			
		||||
func (this *ServerAddressGroup) IsUnix() bool {
 | 
			
		||||
	p := this.Protocol()
 | 
			
		||||
	return p == ProtocolUnix
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsUDP 判断当前分组是否为UDP
 | 
			
		||||
func (this *ServerAddressGroup) IsUDP() bool {
 | 
			
		||||
	p := this.Protocol()
 | 
			
		||||
 
 | 
			
		||||
@@ -27,12 +27,6 @@ func TestServerAddressGroup_Protocol(t *testing.T) {
 | 
			
		||||
		a.IsTrue(group.Protocol() == ProtocolHTTP)
 | 
			
		||||
		a.IsTrue(group.Addr() == "127.0.0.1:1234")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	{
 | 
			
		||||
		group := NewServerAddressGroup("unix:/tmp/my.sock")
 | 
			
		||||
		a.IsTrue(group.Protocol() == ProtocolUnix)
 | 
			
		||||
		a.IsTrue(group.Addr() == "/tmp/my.sock")
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestServerAddressGroup_MatchServerName(t *testing.T) {
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,6 @@ type ServerConfig struct {
 | 
			
		||||
	HTTPS *HTTPSProtocolConfig `yaml:"https" json:"https"` // HTTPS配置
 | 
			
		||||
	TCP   *TCPProtocolConfig   `yaml:"tcp" json:"tcp"`     // TCP配置
 | 
			
		||||
	TLS   *TLSProtocolConfig   `yaml:"tls" json:"tls"`     // TLS配置
 | 
			
		||||
	Unix  *UnixProtocolConfig  `yaml:"unix" json:"unix"`   // Unix配置
 | 
			
		||||
	UDP   *UDPProtocolConfig   `yaml:"udp" json:"udp"`     // UDP配置
 | 
			
		||||
 | 
			
		||||
	// Web配置
 | 
			
		||||
@@ -214,13 +213,6 @@ func (this *ServerConfig) Init(ctx context.Context) (results []error) {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if this.Unix != nil {
 | 
			
		||||
		err := this.Unix.Init()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			results = append(results, err)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if this.UDP != nil {
 | 
			
		||||
		err := this.UDP.Init()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
@@ -295,9 +287,6 @@ func (this *ServerConfig) FullAddresses() []string {
 | 
			
		||||
	if this.TLS != nil && this.TLS.IsOn {
 | 
			
		||||
		result = append(result, this.TLS.FullAddresses()...)
 | 
			
		||||
	}
 | 
			
		||||
	if this.Unix != nil && this.Unix.IsOn {
 | 
			
		||||
		result = append(result, this.Unix.FullAddresses()...)
 | 
			
		||||
	}
 | 
			
		||||
	if this.UDP != nil && this.UDP.IsOn {
 | 
			
		||||
		result = append(result, this.UDP.FullAddresses()...)
 | 
			
		||||
	}
 | 
			
		||||
@@ -319,9 +308,6 @@ func (this *ServerConfig) Listen() []*NetworkAddressConfig {
 | 
			
		||||
	if this.TLS != nil {
 | 
			
		||||
		result = append(result, this.TLS.Listen...)
 | 
			
		||||
	}
 | 
			
		||||
	if this.Unix != nil {
 | 
			
		||||
		result = append(result, this.Unix.Listen...)
 | 
			
		||||
	}
 | 
			
		||||
	if this.UDP != nil {
 | 
			
		||||
		result = append(result, this.UDP.Listen...)
 | 
			
		||||
	}
 | 
			
		||||
@@ -340,10 +326,6 @@ func (this *ServerConfig) IsTCPFamily() bool {
 | 
			
		||||
	return this.TCP != nil || this.TLS != nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *ServerConfig) IsUnixFamily() bool {
 | 
			
		||||
	return this.Unix != nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (this *ServerConfig) IsUDPFamily() bool {
 | 
			
		||||
	return this.UDP != nil
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -22,16 +22,6 @@ func TestServerConfig_Protocols(t *testing.T) {
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		}}
 | 
			
		||||
		server.HTTPS = &HTTPSProtocolConfig{BaseProtocol: BaseProtocol{
 | 
			
		||||
			IsOn: true,
 | 
			
		||||
			Listen: []*NetworkAddressConfig{
 | 
			
		||||
				{
 | 
			
		||||
					Protocol:  ProtocolUnix,
 | 
			
		||||
					Host:      "/hello.sock",
 | 
			
		||||
					PortRange: "1235",
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		}}
 | 
			
		||||
		server.TCP = &TCPProtocolConfig{BaseProtocol: BaseProtocol{
 | 
			
		||||
			IsOn: true,
 | 
			
		||||
			Listen: []*NetworkAddressConfig{
 | 
			
		||||
@@ -50,15 +40,6 @@ func TestServerConfig_Protocols(t *testing.T) {
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		}}
 | 
			
		||||
		server.Unix = &UnixProtocolConfig{BaseProtocol: BaseProtocol{
 | 
			
		||||
			IsOn: true,
 | 
			
		||||
			Listen: []*NetworkAddressConfig{
 | 
			
		||||
				{
 | 
			
		||||
					Protocol:  ProtocolTLS,
 | 
			
		||||
					PortRange: "1234",
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
		}}
 | 
			
		||||
		server.UDP = &UDPProtocolConfig{BaseProtocol: BaseProtocol{
 | 
			
		||||
			IsOn: true,
 | 
			
		||||
			Listen: []*NetworkAddressConfig{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user