appsettings.json 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. {
  2. "//Logging": {
  3. "LogLevel": {
  4. "Default": "Warning"
  5. }
  6. },
  7. "AllowedHosts": "*",
  8. /* 网关配置 */
  9. "Gateway": {
  10. /* url,可多个 */
  11. "urls": [ "http://*:4580" ],
  12. /* 是否允许跨域访问,默认true */
  13. "allowAnyOrigin": true,
  14. /* 把请求的ip地址、端口号复制到请求头中的前缀。若不指定则不复制。 */
  15. "prefixOfCopyIpToHeader": "Sers-Gateway-",
  16. /* http回应中的默认Content-Type。若不指定则默认为 "application/json; charset="+Serialization.Instance.charset */
  17. "//ResponseDefaultContentType": "application/json; charset=UTF-8",
  18. /* 映射静态文件。若不指定则不映射静态文件 */
  19. "staticFiles": {
  20. /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */
  21. //"rootPath": "wwwroot",
  22. /* 默认页面(可不指定)。An ordered list of file names to select by default. List length and ordering may affect performance */
  23. "defaultFileNames": ["index.html"],
  24. /* 是否可浏览目录(default false)。Enables directory browsing */
  25. //"useDirectoryBrowser": false,
  26. /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */
  27. "contentTypeMapFile": "contentTypeMap.json",
  28. /* 回应静态文件时额外添加的http回应头。可不指定。 */
  29. "responseHeaders": {
  30. //设置浏览器静态文件缓存3600秒
  31. "Cache-Control": "public,max-age=3600"
  32. }
  33. }
  34. },
  35. /* asp.net core 原始web服务配置 */
  36. "server": {
  37. "urls": [ "http://*:4580" ]
  38. },
  39. /* 微服务适配器 配置 */
  40. "ServiceAdaptor": [
  41. {
  42. /* 在此Assembly中加载类 */
  43. "assemblyFile": "ServiceAdaptor.NetCore.Sers.dll",
  44. /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */
  45. "className": "ServiceAdaptor.NetCore.Sers.ServiceAdaptor"
  46. /* 配置 */
  47. },
  48. {
  49. /* 在此Assembly中加载类 */
  50. "assemblyFile": "ServiceAdaptor.NetCore.MinHttp.dll",
  51. /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */
  52. "//className": "ServiceAdaptor.NetCore.MinHttp.ServiceAdaptor",
  53. /* 配置 */
  54. /* 网关地址,必须指定 */
  55. "gatewayAddress": "http://127.0.0.1:6080",
  56. /* 超时时间(单位:秒,可不指定)。1小时 */
  57. "//timeoutSeconds": 3600
  58. },
  59. {
  60. /* 在此Assembly中加载类 */
  61. "assemblyFile": "ServiceAdaptor.NetCore.Consul.dll",
  62. /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */
  63. "//className": "ServiceAdaptor.NetCore.Consul.ServiceAdaptor",
  64. /* 配置 */
  65. /* 超时时间(单位:秒,可不指定)。1小时 */
  66. "//timeoutSeconds": 3600,
  67. /* consul的地址。如 http://127.0.0.1:8500 */
  68. "ConsulEndpoint": "http://127.0.0.1:8500",
  69. /* 提供的服务的地址,如 127.0.0.1、sers.cloud */
  70. "serviceHost": "127.0.0.1",
  71. /* 提供的服务的端口号 */
  72. "servicePort": 6003,
  73. /* 提供的服务的名称,如 ServiceProvider */
  74. "serviceName": "Gateway"
  75. },
  76. {
  77. /* 在此Assembly中加载类 */
  78. "assemblyFile": "ServiceAdaptor.NetCore.Be.Eureka.dll",
  79. /* 动态加载的类名,必须继承接口 ServiceAdaptor.NetCore.IServiceAdaptor */
  80. "//className": "ServiceAdaptor.NetCore.Be.Eureka.ServiceAdaptor",
  81. /* 配置 */
  82. /* 超时时间(单位:秒,可不指定)。1小时 */
  83. "//timeoutSeconds": 3600
  84. }
  85. ],
  86. /* Sers配置 begin */
  87. "Sers": {
  88. /* 通讯层配置 */
  89. "CL": {
  90. /* one conn is one channel.can be multiable */
  91. "Client": [
  92. {
  93. // Ipc.NamedPipe
  94. /* (x.1) type */
  95. /* 在此Assembly中查找Builder */
  96. "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll",
  97. /* the class of Builder in assemblyFile */
  98. "className": "Sers.CL.Ipc.NamedPipe.OrganizeClientBuilder",
  99. /* (x.2) config */
  100. // 命名管道只支持本机或局域网。
  101. /* 服务端机器名或者ip地址(如 103.23.23.23 、win10f),默认 "." */
  102. "serverName": ".",
  103. /* 命名管道名称。例如: "Sers.CL.Ipc" */
  104. "pipeName": "Sers.CL.Ipc.4501",
  105. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  106. "secretKey": "SersCL"
  107. },
  108. {
  109. // Socket.Iocp
  110. /* (x.1) type - Iocp */
  111. /* the class of builder in assemblyFile */
  112. //"className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
  113. /* (x.2) conn config */
  114. /* 服务端 host地址。例如: "127.0.0.1"、"serset.com" */
  115. "host": "127.0.0.1",
  116. /* 服务端 监听端口号。例如: 4501 */
  117. "port": 4501,
  118. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  119. "secretKey": "SersCL"
  120. }
  121. ]
  122. },
  123. /* LocalApiService 配置,可不指定 */
  124. "LocalApiService": {
  125. /* 是否 输出本地Api的调用信息到(ApiTrace)Log文件。默认:false */
  126. //"PrintTrace": true,
  127. "workThread": {
  128. /* 后台服务的线程个数(单位个,默认16)(0代表不开启服务) */
  129. "threadCount": 16
  130. }
  131. },
  132. /* ServiceStation配置,可不指定 */
  133. "ServiceStation": {
  134. /* serviceStation站点信息 */
  135. "serviceStationInfo": {
  136. /* 服务站点名称 */
  137. "serviceStationName": "Gateway"
  138. }
  139. }
  140. },
  141. /* Vit工具配置,可不指定 */
  142. "Vit": {
  143. /* 日志配置,可不指定 */
  144. "Logger": {
  145. /* print the log to Log/*.txt default:true */
  146. "PrintToTxt": true,
  147. /* print the log to console. default:true */
  148. "PrintToConsole": true
  149. },
  150. "Kestrel": {
  151. /* (int64) the maximum allowed size of any request body in bytes. When set to null, the maximum request body size is unlimited. */
  152. "MaxRequestBodySize": 2000000000,
  153. /* (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. */
  154. "ValueLengthLimit": 2000000000,
  155. /* (int64) A limit for the length of each multipart body. Forms sections that exceed this limit will throw an System.IO.InvalidDataException when parsed. */
  156. "MultipartBodyLengthLimit": 2000000000
  157. }
  158. },
  159. /* Sers配置 end */
  160. /* BeEureka配置 begin */
  161. "spring": {
  162. "application": {
  163. "name": "ServiceAdaptor_Gateway" //服务名称
  164. }
  165. },
  166. "eureka": {
  167. "client": {
  168. "serviceUrl": "http://direwolf:direwolf@192.168.1.204:8762/eureka/", //注册中心地址
  169. "validate_certificates": false
  170. },
  171. "instance": {
  172. "leaseRenewalIntervalInSeconds": 120,
  173. "leaseExpirationDurationInSeconds": 120,
  174. "port": 6003, //服务端口
  175. "preferIpAddress": true, //表示使用当前ip作为服务的ip
  176. "metadataMap": { //里面的参数都是国网要求
  177. "auth-code": "HWJCGliay4uXH3xhUTaXnB==",
  178. "service-name": "ServiceAdaptor_Gateway", //服务中文名称
  179. "service-desc": "ServiceAdaptor_Gateway", //服务描述
  180. "service-namespace": "XMGL",
  181. "service-sys": "JJQGC"
  182. }
  183. }
  184. }
  185. /* BeEureka配置 end */
  186. }