appsettings.json 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. {
  2. "Sers": {
  3. /* 通讯层配置 */
  4. "CL": {
  5. /* 共用配置,子项共用,覆写子项未指定的配置 */
  6. "Config": {
  7. "workThread": {
  8. // 模式,可为 LongThread(默认)、LongThread_TimeLimit、ManagedThread、ConsumerCascade
  9. "mode": "LongThread",
  10. /* 后台处理消息的线程个数(单位个,默认2) */
  11. "threadCount": 2,
  12. /* 最大线程数(包含常驻线程和临时线程),默认100。仅当mode为ManagedThread时有效 */
  13. "maxThreadCount": 100,
  14. /* 等待队列的最大长度(默认:100000)。仅当mode为LongThread_TimeLimit和ManagedThread时有效 */
  15. "pendingQueueLength": 100000,
  16. /* 超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、ManagedThread时有效 */
  17. "timeoutMs": 300000
  18. },
  19. /* 请求超时时间(单位ms,默认300000) */
  20. "requestTimeoutMs": 300000,
  21. //HeartBeat
  22. /* 心跳检测时间间隔(单位ms,默认10000,若指定为0则不进行心跳检测) */
  23. "heartBeatIntervalMs": 10000,
  24. /* 心跳检测超时时间(单位ms,默认30000) */
  25. "heartBeatTimeoutMs": 30000,
  26. /* 心跳检测失败重试次数(单位次,默认10) */
  27. "heartBeatRetryCount": 10,
  28. /* 数据传输 加密协议,可多个,可不指定 */
  29. "//security": [
  30. {
  31. // SampleSecurity
  32. /* 在此Assembly中查找security */
  33. "assemblyFile": "Sers.Core.dll",
  34. /* the class of security in assemblyFile. 必须继承接口 Sers.Core.Util.StreamSecurity.ISecurity */
  35. "className": "Sers.Core.Util.StreamSecurity.Security.SampleSecurity",
  36. /* (x.2) config */
  37. /* 加密密钥 */
  38. "secret": "security"
  39. },
  40. {
  41. // SampleSecurity
  42. /* 若不指定assemblyFile和className 则默认为Sers.Core.Util.StreamSecurity.Security.SampleSecurity */
  43. "secret": "Two layer encryption"
  44. }
  45. ],
  46. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  47. "secretKey": "SersCL"
  48. },
  49. /* one conn is one channel.can be multiable */
  50. "Server": [
  51. {
  52. //Ipc.NamedPipe
  53. /* (x.1) type */
  54. /* 在此Assembly中查找builder */
  55. "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll",
  56. /* the class of builder in assemblyFile */
  57. //"className": "Sers.CL.Ipc.NamedPipe.OrganizeServerBuilder",
  58. /* (x.2) config */
  59. /* 命名管道名称。例如: "Sers.CL.Ipc" */
  60. "pipeName": "Sers.CL.Ipc.4501"
  61. },
  62. {
  63. // Socket.Iocp
  64. /* (x.1) type - Iocp */
  65. /* the class of builder in assemblyFile */
  66. "className": "Sers.CL.Socket.Iocp.OrganizeServerBuilder",
  67. /* 通信模式(默认值:Simple)。可为 Simple、Timer、ThreadWait */
  68. //"mode": "ThreadWait",
  69. /* 接收缓存区大小(单位:byte,默认:8192) */
  70. //"receiveBufferSize": 8192,
  71. /* 发送缓冲区刷新间隔(单位:毫秒,默认:1)(仅当mode为Timer和ThreadWait时有效) */
  72. //"sendFlushInterval": 1,
  73. /* 发送缓冲区数据块的最小大小(单位:byte,默认 1000000)(仅当mode为Timer和ThreadWait时有效) */
  74. //"sendBufferSize": 1000000,
  75. /* 发送缓冲区个数(默认1024)(仅当mode为Timer和ThreadWait时有效) */
  76. //"sendBufferCount": 1024,
  77. /* (x.2) config */
  78. /* 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。*/
  79. //"host": "127.0.0.1",
  80. /* 服务端 监听端口号。例如: 4501 */
  81. "port": 4501
  82. },
  83. {
  84. // Socket.ThreadWait
  85. /* (x.1) type - Socket */
  86. /* the class of builder in assemblyFile */
  87. //"className": "Sers.CL.Socket.ThreadWait.OrganizeServerBuilder",
  88. /* (x.2) config */
  89. /* 服务端 监听地址。若不指定则监听所有网卡。例如: "127.0.0.1"、"sers.cloud"。*/
  90. //"host": "127.0.0.1",
  91. /* 服务端 监听端口号。例如: 4501 */
  92. "port": 4501
  93. },
  94. {
  95. // Zmq.ThreadWait
  96. /* (x.1) type */
  97. /* 在此Assembly中查找builder */
  98. "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
  99. /* the class of builder in assemblyFile */
  100. //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeServerBuilder",
  101. /* (x.2) config */
  102. /* 地址。例如: "tcp://*:4502" 、 "ipc://4502" */
  103. "endpoint": "tcp://*:4502"
  104. },
  105. {
  106. // WebSocket
  107. /* (x.1) type - Iocp */
  108. /* 在此Assembly中查找builder */
  109. "assemblyFile": "Sers.CL.WebSocket.dll",
  110. /* the class of builder in assemblyFile */
  111. //"className": "Sers.CL.WebSocket.OrganizeServerBuilder",
  112. /* (x.2) config */
  113. /* 服务端地址(默认为 "ws://0.0.0.0:4503") */
  114. "host": "ws://0.0.0.0:4503"
  115. },
  116. {
  117. // Zmq.FullDuplex
  118. /* (x.1) type */
  119. /* 在此Assembly中查找builder */
  120. "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
  121. /* the class of builder in assemblyFile */
  122. //"className": "Sers.CL.Zmq.FullDuplex.OrganizeServerBuilder",
  123. /* (x.2) config */
  124. /* 地址。例如: "tcp://*:4504" 、 "ipc://4504" */
  125. "endpoint": "tcp://*:4504"
  126. },
  127. {
  128. //Ipc.SharedMemory
  129. /* (x.1) type - Ipc.SharedMemory */
  130. /* 在此Assembly中查找builder */
  131. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  132. /* the class of builder in assemblyFile */
  133. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeServerBuilder",
  134. /* (x.2) config */
  135. /* 共享内存名称。例如: "ipcTest" */
  136. "name": "ipcForStationDemo",
  137. /* 共享内存节点个数。例如: 64 */
  138. "nodeCount": 128,
  139. /* 共享内存节点大小。例如: 2048 */
  140. "nodeBufferSize": 102400
  141. },
  142. {
  143. /* (x.1) type - Ipc.SharedMemory */
  144. /* 在此Assembly中查找builder */
  145. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  146. /* the class of builder in assemblyFile */
  147. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeServerBuilder",
  148. /* (x.2) config */
  149. /* 共享内存名称。例如: "ipcTest" */
  150. "name": "ipcForRobot",
  151. /* 共享内存节点个数。例如: 64 */
  152. "nodeCount": 128,
  153. /* 共享内存节点大小。例如: 2048 */
  154. "nodeBufferSize": 102400
  155. }
  156. ]
  157. },
  158. // RpcData序列化模式。可不指定。默认为Text。
  159. // 可为 Newtonsoft、Text、BytePointor。
  160. // 效率依次递增。BytePointor 序列化为二进制数据而不是json字符串。
  161. "RpcDataSerializeMode": "Text",
  162. /* LocalApiService 配置,可不指定 */
  163. "LocalApiService": {
  164. /* 是否 输出本地Api的调用信息到(ApiTrace)Log文件。默认:false */
  165. "PrintTrace": false,
  166. "workThread": {
  167. // 模式,可为 LongThread(默认)、LongThread_TimeLimit、ManagedThread、ConsumerCascade
  168. "mode": "LongThread",
  169. /* 后台服务的线程个数(单位个,默认16)(0代表不开启服务) */
  170. "threadCount": 4,
  171. /* 最大线程数(包含常驻线程和临时线程),默认100。仅当mode为ManagedThread时有效 */
  172. "maxThreadCount": 100,
  173. /* 等待队列的最大长度(默认:100000)。仅当mode为LongThread_TimeLimit和ManagedThread时有效 */
  174. "pendingQueueLength": 100000,
  175. /* 超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、ManagedThread时有效 */
  176. "timeoutMs": 300000
  177. },
  178. /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
  179. "//staticFiles": [
  180. {
  181. /* api路由前缀,例如 "/demo/ui/*" */
  182. "route": "/demo/ui/*",
  183. /* api描述,静态文件描述 */
  184. "apiName": "demo站点静态文件",
  185. /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则默认为入口程序所在目录。demo:"wwwroot/demo" */
  186. "rootPath": "wwwroot/demo",
  187. /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */
  188. "contentTypeMapFile": "contentTypeMap.json",
  189. /* 回应静态文件时额外添加的http回应头。可不指定。 */
  190. "responseHeaders": {
  191. //设置浏览器静态文件缓存3600秒
  192. "Cache-Control": "public,max-age=3600"
  193. }
  194. }
  195. ],
  196. /* 默认站点名称,可多个,可不指定 */
  197. //"apiStationNames": [ "demo" ],
  198. /* Api加载器配置 */
  199. "//ApiLoaders": [
  200. {
  201. /* 在此Assembly中查找api加载器(如 Sers.Core.dll 、Sers.NetcoreLoader.dll 、 Sers.Serslot.dll ) */
  202. //"loader_assemblyFile": "Sers.Core.dll",
  203. /* 加载器的类名,可为 Sers.SersLoader.ApiLoader 、 Sers.NetcoreLoader.ApiLoader、 Sers.Serslot.ApiLoader 等。若不指定则默认为"Sers.SersLoader.ApiLoader" */
  204. //"loader_className": "Sers.SersLoader.ApiLoader",
  205. //(通过反射从此包中获取要加载的api)
  206. /* 在此Assembly中查找服务(如 Did.SersLoader.Demo.dll)(assembly、assemblyFile、assemblyName 指定任一即可) */
  207. "assemblyFile": "Did.SersLoader.Demo.dll",
  208. /* 在此Assembly中查找服务(如 Did.SersLoader.Demo)(assembly、assemblyFile、assemblyName 指定任一即可) */
  209. //"assemblyName": "Did.SersLoader.Demo",
  210. /* 强制指定ApiStation名称。可不指定。(优先级从高到低: apiStationName_Force 、 在代码上的SsStationNameAttribute特性指定 、 apiStationName 、 appsettings.json指定) */
  211. //"apiStationName_Force": "",
  212. /* ApiStation名称。可不指定。(优先级从高到低: apiStationName_Force 、 在代码上的SsStationNameAttribute特性指定 、 apiStationName 、 appsettings.json指定) */
  213. "apiStationName": "demo"
  214. /* 强制路由前缀,例如:"demo/v1"。可不指定。(优先级从高到低: routePrefix_Force、在代码上的SsRoutePrefixAttribute特性指定 、 routePrefix) */
  215. //"routePrefix_Force": "",
  216. /* 路由前缀,例如:"demo/v1"。可不指定。(优先级从高到低: routePrefix_Force、在代码上的SsRoutePrefixAttribute特性指定 、 routePrefix ) */
  217. //"routePrefix": ""
  218. }
  219. ],
  220. /* 调用Api时的自定义Scope对象。可不指定。事件顺序为 OnCreateScope -> BeforeCallApi -> OnDispose */
  221. "//OnCreateScope": [
  222. {
  223. /* 在此Assembly中加载类 */
  224. "assemblyFile": "Sers.ApiTrace.dll",
  225. /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.ApiScope.IApiScopeEvent */
  226. "className": "Sers.ApiTrace.ApiScope"
  227. }
  228. ],
  229. /* 调用api前的事件,可不指定。事件顺序为 OnCreateScope -> BeforeCallApi -> OnDispose */
  230. "//BeforeCallApi": [
  231. {
  232. /* 在此Assembly中加载类 */
  233. "assemblyFile": "Sers.Core.dll",
  234. /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
  235. "className": "Bearer",
  236. //Bearer: 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),并作为参数调用接口api_verifyAt,把返回数据放到 rpcData.user.userInfo
  237. /* 验证at接口的地址 */
  238. "api_verifyAt": "/AuthCenter/account/verifyAt",
  239. /* 验证at接口的httpMethod。(如 GET POST 可不指定) */
  240. "api_httpMethod": "POST"
  241. },
  242. {
  243. //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
  244. "className": "AccountInCookie",
  245. "account": [
  246. {
  247. "userToken": "admin_123456",
  248. //"CallerSource": "Internal",
  249. "userInfo": {
  250. "name": "超级管理员",
  251. "入口": "Gover网关"
  252. }
  253. }
  254. ]
  255. }
  256. ]
  257. },
  258. /* ServiceStation配置,可不指定 */
  259. "ServiceStation": {
  260. /* 自动上报cpu Usage。不指定则不上报 */
  261. "//UsageReporter": {
  262. /* 上报时间间隔(单位:秒) */
  263. "intervalSecond": 2
  264. },
  265. /* serviceStation站点信息 */
  266. "serviceStationInfo": {
  267. /* 服务站点名称 */
  268. "serviceStationName": "ServiceCenter",
  269. /* 服务站点版本信息,若不指定则为入口链接库的版本号 */
  270. //"stationVersion": "2.1.1",
  271. /* [json]服务站点额外信息,可不指定 */
  272. "info": null
  273. }
  274. },
  275. /* ServiceCenter 配置,可不指定 */
  276. "ServiceCenter": {
  277. /* 是否 输出Api注册事件到(Info)Log文件。默认:true */
  278. "ApiRegistEvent_Print": true,
  279. /* api路由管理方式,可不指定。可为:"RESTful","IgnoreHttpMethod"。若不指定或未指定有效值,则默认为"RESTful" */
  280. //"ApiRouteType": "IgnoreHttpMethod",
  281. //调用api前的事件,可不指定
  282. "//BeforeCallApi": [
  283. {
  284. /* 在此Assembly中加载类 */
  285. "assemblyFile": "Sers.Core.dll",
  286. /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
  287. "className": "Bearer",
  288. //Bearer: 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),并作为参数调用接口api_verifyAt,把返回数据放到 rpcData.user.userInfo
  289. /* 验证at接口的地址 */
  290. "api_verifyAt": "/AuthCenter/account/verifyAt",
  291. /* 验证at接口的httpMethod。(如 GET POST 可不指定) */
  292. "api_httpMethod": "POST"
  293. },
  294. {
  295. //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
  296. //"className": "AccountInCookie",
  297. "account": [
  298. {
  299. "userToken": "admin_123456",
  300. //"CallerSource": "Internal",
  301. "userInfo": {
  302. "name": "超级管理员",
  303. "入口": "Gover网关"
  304. }
  305. }
  306. ]
  307. }
  308. ]
  309. },
  310. /* 动态加载的App事件 */
  311. "AppEvent": [
  312. { //记录请求Trace到Zipkin
  313. /* 在此Assembly中加载类 */
  314. "assemblyFile": "Sers.Gover.Apm.Zipkin.dll",
  315. /* 动态加载的类名,必须继承接口 Sers.Core.Module.App.AppEvent.IAppEvent */
  316. //"className": "Sers.Gover.Apm.Zipkin.AppEvent",
  317. //启用Zipkin链路追踪(自动提交应用调用信息)
  318. /* 配置 */
  319. "SamplingRate": "1.0",
  320. "zipkinCollectorUrl": "http://sers.cloud:9411",
  321. /* 若不指定则默认为ServiceCenter */
  322. "rpcName": "ServiceCenter",
  323. "tags": {
  324. // 可为 requestRpc requestData responseRpc responseData
  325. "traceName": "demoTrace",
  326. "route": "{{requestRpc.route}}",
  327. "{{requestRpc.route}}": "route",
  328. "url": "{{requestRpc.http.url}}",
  329. "method": "{{requestRpc.http.method}}",
  330. "requestRpc": "{{requestRpc}}",
  331. //"requestData": "{{requestData}}",
  332. "responseRpc": "{{responseRpc}}",
  333. "responseState": "{{responseRpc.http.headers.responseState}}",
  334. "responseError_Base64": "{{responseRpc.http.headers.responseError_Base64}}"
  335. //"responseData": "{{responseData}}",
  336. //"responseData.error": "{{responseData.error}}"
  337. }
  338. },
  339. { //记录请求Trace到 Log/{yyyy-MM}/[{yyyy-MM-dd}]ApiTrace.txt文件
  340. /* 在此Assembly中加载类 */
  341. "assemblyFile": "Sers.Gover.Apm.Txt.dll",
  342. /* 动态加载的类名,必须继承接口 Sers.Core.Module.App.AppEvent.IAppEvent */
  343. //"className": "Sers.Gover.Apm.Txt.AppEvent",
  344. "tags": {
  345. // 可为 requestRpc requestData responseRpc responseData
  346. "From": "Sers.Gover.Apm.Txt",
  347. "route": "{{requestRpc.route}}",
  348. //"{{requestRpc.route}}": "route",
  349. "url": "{{requestRpc.http.url}}",
  350. "method": "{{requestRpc.http.method}}",
  351. "requestRpc": "{{requestRpc}}",
  352. //"requestData": "{{requestData}}",
  353. "responseRpc": "{{responseRpc}}",
  354. "responseState": "{{responseRpc.http.headers.responseState}}"
  355. //"responseError_Base64": "{{responseRpc.http.headers.responseError_Base64}}"
  356. //"responseData": "{{responseData}}",
  357. //"responseData.error": "{{responseData.error}}"
  358. }
  359. }
  360. ],
  361. /* 网关配置。若不指定,则不开启网关服务 */
  362. "Gateway": {
  363. /* Rpc配置,可不指定 */
  364. "Rpc": {
  365. /* 网关转发的请求中的rpc 信息中的 CallerSource。(暗指调用来源,默认"OutSide") */
  366. //"CallerSource": "OutSide"
  367. },
  368. "WebHost": {
  369. /* url,可多个 */
  370. "urls": [ "http://*:4580" ],
  371. /* 是否允许跨域访问,默认true */
  372. "allowAnyOrigin": true,
  373. /* 把请求的ip地址、端口号复制到请求头中的前缀。若不指定则不复制。 */
  374. "prefixOfCopyIpToHeader": "Sers-Gateway-",
  375. /* http回应中的默认Content-Type。若不指定则默认为 "application/json; charset="+Serialization.Instance.charset */
  376. "//ResponseDefaultContentType": "application/json; charset=UTF-8",
  377. /* 映射静态文件。若不指定则不映射静态文件 */
  378. "staticFiles": {
  379. /* 请求路径(可不指定)。demo:"/file/static"。The relative request path that maps to static resources */
  380. //"requestPath": "/file",
  381. /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */
  382. //"rootPath": "wwwroot",
  383. /* 默认页面(可不指定)。An ordered list of file names to select by default. List length and ordering may affect performance */
  384. "defaultFileNames": [ "index.html" ],
  385. /* 是否可浏览目录(default false)。Enables directory browsing */
  386. //"useDirectoryBrowser": false,
  387. /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */
  388. "contentTypeMapFile": "contentTypeMap.json",
  389. /* 回应静态文件时额外添加的http回应头。可不指定。 */
  390. "responseHeaders": {
  391. //设置浏览器静态文件缓存3600秒
  392. "Cache-Control": "public,max-age=3600"
  393. }
  394. }
  395. },
  396. //调用api前的事件,可不指定
  397. "BeforeCallApi": [
  398. {
  399. /* 在此Assembly中加载类 */
  400. "assemblyFile": "Sers.Core.dll",
  401. /* 动态加载的类名,必须继承接口 Sers.Core.Module.Api.ApiEvent.BeforeCallApi.IBeforeCallApi */
  402. //"className": "Bearer",
  403. //Bearer: 在调用接口前,会获取 rpcData.http.headers.Authorization(格式为 "Bearer xxxxxx"),并作为参数调用接口api_verifyAt,把返回数据放到 rpcData.user.userInfo
  404. /* 验证at接口的地址 */
  405. "api_verifyAt": "/AuthCenter/account/verifyAt",
  406. /* 验证at接口的httpMethod。(如 GET POST 可不指定) */
  407. "api_httpMethod": "POST"
  408. },
  409. {
  410. //AccountInCookie 在调用接口前,会获取 rpcData.http.headers.Cookie(格式为 "user=xxx;c=7")中的user,在账号列表中比对userToken,回写 CallerSource(rpcData.caller.source) 和 userInfo(rpcData.user.userInfo)
  411. "className": "AccountInCookie",
  412. "account": [
  413. {
  414. "userToken": "admin_123456",
  415. "CallerSource": "Internal",
  416. "userInfo": {
  417. "name": "Gover管理员",
  418. "入口": "Gover网关"
  419. }
  420. }
  421. ]
  422. }
  423. ],
  424. /* 服务限流配置,可不指定 */
  425. "rateLimit": [
  426. {
  427. /* 服务限流key,标识一个限流服务,必须唯一 */
  428. "rateLimitKey": "rate",
  429. /* 固定时间窗口限流。在单位时间(msInterval)内限制最大请求数量为reqLimit。超出数量的请求将被拒绝 */
  430. "rateLimitType": "FixedWindow",
  431. /* 单位时间内最大请求数量(个)*/
  432. "reqLimit": 100000,
  433. /* 单位时间长度(单位:ms)*/
  434. "msInterval": 1000
  435. }
  436. ]
  437. }
  438. },
  439. /* Vit工具配置,可不指定 */
  440. "Vit": {
  441. /* 日志配置,可不指定 */
  442. "Logger": {
  443. /* print the log to Log/*.txt default:true */
  444. "PrintToTxt": true,
  445. /* print the log to console. default:true */
  446. "PrintToConsole": true
  447. },
  448. /* 序列化配置,可不指定 */
  449. "Serialization": {
  450. /* 序列化字符编码。可不指定,默认 UTF8。只可为 UTF7,UTF8,UTF32,ASCII,Unicode。 */
  451. "Encoding": "UTF8",
  452. /* 时间序列化格式。可不指定,默认 "yyyy-MM-dd HH:mm:ss" */
  453. "DateTimeFormat": "yyyy-MM-dd HH:mm:ss"
  454. },
  455. "//Kestrel": {
  456. /* (int64) the maximum allowed size of any request body in bytes. When set to null, the maximum request body size is unlimited. */
  457. "MaxRequestBodySize": 2000000000,
  458. /* (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. */
  459. "ValueLengthLimit": 2000000000,
  460. /* (int64) A limit for the length of each multipart body. Forms sections that exceed this limit will throw an System.IO.InvalidDataException when parsed. */
  461. "MultipartBodyLengthLimit": 2000000000
  462. }
  463. }
  464. }