{ "//Logging": { "LogLevel": { "Default": "Warning" } }, "AllowedHosts": "*", /* 网关配置 */ "Gateway": { /* url,可多个 */ "urls": [ "http://*:4580" ], /* 是否允许跨域访问,默认true */ "allowAnyOrigin": true, /* 把请求的ip地址、端口号复制到请求头中的前缀。若不指定则不复制。 */ "prefixOfCopyIpToHeader": "Sers-Gateway-", /* http回应中的默认Content-Type。若不指定则默认为 "application/json; charset="+Serialization.Instance.charset */ "//ResponseDefaultContentType": "application/json; charset=UTF-8", /* 映射静态文件。若不指定则不映射静态文件 */ "staticFiles": { /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */ //"rootPath": "wwwroot", /* 默认页面(可不指定)。An ordered list of file names to select by default. List length and ordering may affect performance */ "defaultFileNames": ["index.html"], /* 是否可浏览目录(default false)。Enables directory browsing */ //"useDirectoryBrowser": false, /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */ "contentTypeMapFile": "contentTypeMap.json", /* 回应静态文件时额外添加的http回应头。可不指定。 */ "responseHeaders": { //设置浏览器静态文件缓存3600秒 "Cache-Control": "public,max-age=3600" } } }, /* asp.net core 原始web服务配置 */ "server": { "urls": [ "http://*:4580" ] }, /* 微服务适配器 配置 */ "ServiceAdaptor": [ { /* 在此Assembly中加载类 */ "assemblyFile": "ServiceAdaptor.NetCore.Sers.dll", /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */ "className": "ServiceAdaptor.NetCore.Sers.ServiceAdaptor" /* 配置 */ }, { /* 在此Assembly中加载类 */ "assemblyFile": "ServiceAdaptor.NetCore.MinHttp.dll", /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */ "//className": "ServiceAdaptor.NetCore.MinHttp.ServiceAdaptor", /* 配置 */ /* 网关地址,必须指定 */ "gatewayAddress": "http://127.0.0.1:6080", /* 超时时间(单位:秒,可不指定)。1小时 */ "//timeoutSeconds": 3600 }, { /* 在此Assembly中加载类 */ "assemblyFile": "ServiceAdaptor.NetCore.Consul.dll", /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */ "//className": "ServiceAdaptor.NetCore.Consul.ServiceAdaptor", /* 配置 */ /* 超时时间(单位:秒,可不指定)。1小时 */ "//timeoutSeconds": 3600, /* consul的地址。如 http://127.0.0.1:8500 */ "ConsulEndpoint": "http://127.0.0.1:8500", /* 提供的服务的地址,如 127.0.0.1、sers.cloud */ "serviceHost": "127.0.0.1", /* 提供的服务的端口号 */ "servicePort": 6003, /* 提供的服务的名称,如 ServiceProvider */ "serviceName": "Gateway" }, { /* 在此Assembly中加载类 */ "assemblyFile": "ServiceAdaptor.NetCore.Be.Eureka.dll", /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */ "//className": "ServiceAdaptor.NetCore.Be.Eureka.ServiceAdaptor", /* 配置 */ /* 超时时间(单位:秒,可不指定)。1小时 */ "//timeoutSeconds": 3600 } ], /* Sers配置 begin */ "Sers": { /* 通讯层配置 */ "CL": { /* one conn is one channel.can be multiable */ "Client": [ { // Ipc.NamedPipe /* (x.1) type */ /* 在此Assembly中查找Builder */ "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll", /* the class of Builder in assemblyFile */ "className": "Sers.CL.Ipc.NamedPipe.OrganizeClientBuilder", /* (x.2) config */ // 命名管道只支持本机或局域网。 /* 服务端机器名或者ip地址(如 103.23.23.23 、win10f),默认 "." */ "serverName": ".", /* 命名管道名称。例如: "Sers.CL.Ipc" */ "pipeName": "Sers.CL.Ipc.4501", /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */ "secretKey": "SersCL" }, { // Socket.Iocp /* (x.1) type - Iocp */ /* the class of builder in assemblyFile */ //"className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder", /* (x.2) conn config */ /* 服务端 host地址。例如: "127.0.0.1"、"serset.com" */ "host": "127.0.0.1", /* 服务端 监听端口号。例如: 4501 */ "port": 4501, /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */ "secretKey": "SersCL" } ] }, /* LocalApiService 配置,可不指定 */ "LocalApiService": { /* 是否 输出本地Api的调用信息到(ApiTrace)Log文件。默认:false */ //"PrintTrace": true, "workThread": { /* 后台服务的线程个数(单位个,默认16)(0代表不开启服务) */ "threadCount": 16 } }, /* ServiceStation配置,可不指定 */ "ServiceStation": { /* serviceStation站点信息 */ "serviceStationInfo": { /* 服务站点名称 */ "serviceStationName": "Gateway" } } }, /* Vit工具配置,可不指定 */ "Vit": { /* 日志配置,可不指定 */ "Logger": { /* print the log to Log/*.txt default:true */ "PrintToTxt": true, /* print the log to console. default:true */ "PrintToConsole": true }, "Kestrel": { /* (int64) the maximum allowed size of any request body in bytes. When set to null, the maximum request body size is unlimited. */ "MaxRequestBodySize": 2000000000, /* (int32) A limit on the length of individual form values. Forms containing values that exceed this limit will throw an System.IO.InvalidDataException when parsed. */ "ValueLengthLimit": 2000000000, /* (int64) A limit for the length of each multipart body. Forms sections that exceed this limit will throw an System.IO.InvalidDataException when parsed. */ "MultipartBodyLengthLimit": 2000000000 } }, /* Sers配置 end */ /* BeEureka配置 begin */ "spring": { "application": { "name": "ServiceAdaptor_Gateway" //服务名称 } }, "eureka": { "client": { "serviceUrl": "http://direwolf:direwolf@192.168.1.204:8762/eureka/", //注册中心地址 "validate_certificates": false }, "instance": { "leaseRenewalIntervalInSeconds": 120, "leaseExpirationDurationInSeconds": 120, "port": 6003, //服务端口 "preferIpAddress": true, //表示使用当前ip作为服务的ip "metadataMap": { //里面的参数都是国网要求 "auth-code": "HWJCGliay4uXH3xhUTaXnB==", "service-name": "ServiceAdaptor_Gateway", //服务中文名称 "service-desc": "ServiceAdaptor_Gateway", //服务描述 "service-namespace": "XMGL", "service-sys": "JJQGC" } } } /* BeEureka配置 end */ }