appsettings.json 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. {
  2. "Sers": {
  3. /* 通讯层配置 */
  4. "CL": {
  5. /* 共用配置,子项共用,覆写子项未指定的配置 */
  6. "Config": {
  7. "workThread": {
  8. // 模式,可为 LongThread(默认)、LongThread_TimeLimit、LongTask、LongTask_TimeLimit、ConsumerCascade
  9. "mode": "LongThread",
  10. /* 后台处理消息的线程个数(单位个,默认2) */
  11. "threadCount": 2,
  12. /* 请求超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、LongTask_TimeLimit时有效 */
  13. "timeoutMs": 300000
  14. },
  15. /* 请求超时时间(单位ms,默认300000) */
  16. "requestTimeoutMs": 300000,
  17. /* 数据传输 加密协议,可多个,可不指定 */
  18. "//security": [
  19. {
  20. // SampleSecurity
  21. /* 在此Assembly中查找security */
  22. "assemblyFile": "Sers.Core.dll",
  23. /* the class of security in assemblyFile. 必须继承接口 Sers.Core.Util.StreamSecurity.ISecurity */
  24. "className": "Sers.Core.Util.StreamSecurity.Security.SampleSecurity",
  25. /* (x.2) config */
  26. /* 加密密钥 */
  27. "secret": "security"
  28. },
  29. {
  30. // SampleSecurity
  31. /* 若不指定assemblyFile和className 则默认为Sers.Core.Util.StreamSecurity.Security.SampleSecurity */
  32. "secret": "Two layer encryption"
  33. }
  34. ],
  35. /* 连接秘钥,用以验证连接安全性。服务端和客户端必须一致 */
  36. "secretKey": "SersCL"
  37. },
  38. /* one conn is one channel.can be multiable */
  39. "Client": [
  40. {
  41. // Ipc.NamedPipe
  42. /* (x.1) type */
  43. /* 在此Assembly中查找builder */
  44. "assemblyFile": "Sers.CL.Ipc.NamedPipe.dll",
  45. /* the class of builder in assemblyFile */
  46. //"className": "Sers.CL.Ipc.NamedPipe.OrganizeClientBuilder",
  47. /* (x.2) config */
  48. // 命名管道只支持本机或局域网。
  49. /* 服务端机器名或者ip地址(如 103.23.23.23 、win10f),默认 "." */
  50. "serverName": ".",
  51. /* 命名管道名称。例如: "Sers.CL.Ipc" */
  52. "pipeName": "Sers.CL.Ipc.4501"
  53. },
  54. {
  55. // Socket.Iocp
  56. /* (x.1) type - Iocp */
  57. /* 在此Assembly中查找builder */
  58. //"assemblyFile": "Sers.CL.Socket.Iocp.dll",
  59. /* the class of builder in assemblyFile */
  60. "className": "Sers.CL.Socket.Iocp.OrganizeClientBuilder",
  61. /* 通信模式(默认值:Simple)。可为 Simple、Timer、ThreadWait */
  62. //"mode": "ThreadWait",
  63. /* (x.2) config */
  64. /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
  65. "host": "127.0.0.1",
  66. /* 服务端 监听端口号。例如: 4501 */
  67. "port": 4501
  68. },
  69. {
  70. // Socket.ThreadWait
  71. /* (x.1) type - ThreadWait */
  72. /* the class of builder in assemblyFile */
  73. //"className": "Sers.CL.Socket.ThreadWait.OrganizeClientBuilder",
  74. /* (x.2) config */
  75. /* 服务端 host地址。例如: "127.0.0.1"、"sers.cloud" */
  76. "host": "127.0.0.1",
  77. /* 服务端 监听端口号。例如: 4501 */
  78. "port": 4501
  79. },
  80. {
  81. // Zmq.ThreadWait
  82. /* (x.1) type */
  83. /* 在此Assembly中查找builder */
  84. "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
  85. /* the class of builder in assemblyFile */
  86. //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeClientBuilder",
  87. /* (x.2) config */
  88. /* 地址。例如: "tcp://127.0.0.1:4502" 、 "ipc://4502" */
  89. "endpoint": "tcp://127.0.0.1:4502"
  90. },
  91. {
  92. // WebSocket
  93. /* (x.1) type - WebSocket */
  94. /* 在此Assembly中查找builder */
  95. "assemblyFile": "Sers.CL.WebSocket.dll",
  96. /* the class of builder in assemblyFile */
  97. //"className": "Sers.CL.WebSocket.OrganizeClientBuilder",
  98. /* (x.2) config */
  99. /* 服务端地址(默认为 "ws://127.0.0.1:4503") */
  100. "host": "ws://127.0.0.1:4503"
  101. },
  102. {
  103. // Zmq.FullDuplex
  104. /* (x.1) type */
  105. /* 在此Assembly中查找builder */
  106. "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
  107. /* the class of builder in assemblyFile */
  108. //"className": "Sers.CL.Zmq.FullDuplex.OrganizeClientBuilder",
  109. /* (x.2) config */
  110. /* 地址。例如: "tcp://127.0.0.1:4504" 、 "ipc://4504" */
  111. "endpoint": "tcp://127.0.0.1:4504"
  112. },
  113. {
  114. // Ipc.SharedMemory
  115. /* (x.1) type - Ipc.SharedMemory */
  116. /* 在此Assembly中查找builder */
  117. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  118. /* the class of builder in assemblyFile */
  119. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeClientBuilder",
  120. /* (x.2) config */
  121. /* 共享内存名称。例如: "ipcTest" */
  122. "name": "ipcForRobot"
  123. }
  124. ]
  125. },
  126. /* LocalApiService 配置,可不指定 */
  127. "LocalApiService": {
  128. /* 是否 输出本地Api的调用信息到(ApiTrace)Log文件。默认:false */
  129. "PrintTrace": false,
  130. "workThread": {
  131. // 模式,可为 LongThread(默认)、LongThread_TimeLimit、LongTask、LongTask_TimeLimit、ConsumerCascade
  132. "mode": "LongThread",
  133. /* 后台服务的线程个数(单位个,默认16)(0代表不开启服务) */
  134. "threadCount": 4,
  135. /* 请求超时时间(单位ms,默认300000),仅当mode为LongThread_TimeLimit、LongTask_TimeLimit时有效 */
  136. "timeoutMs": 300000
  137. },
  138. /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
  139. "staticFiles": [
  140. {
  141. /* api路由前缀,例如 "/demo/ui/*" */
  142. "route": "/_robot_/*",
  143. /* api描述,静态文件描述 */
  144. "apiName": "robot站点静态文件",
  145. /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */
  146. "rootPath": "wwwroot/_robot_",
  147. /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */
  148. "contentTypeMapFile": "contentTypeMap.json",
  149. /* 回应静态文件时额外添加的http回应头。可不指定。 */
  150. "responseHeaders": {
  151. //设置浏览器静态文件缓存3600秒
  152. "Cache-Control": "public,max-age=3600"
  153. }
  154. }
  155. ]
  156. },
  157. /* ServiceStation配置,可不指定 */
  158. "ServiceStation": {
  159. /* serviceStation站点信息 */
  160. "serviceStationInfo": {
  161. "serviceStationName": "Robot"
  162. }
  163. }
  164. },
  165. /* Vit工具配置,可不指定 */
  166. "Vit": {
  167. /* 日志配置,可不指定 */
  168. "Logger": {
  169. /* print the log to Log/*.txt default:true */
  170. "PrintToTxt": true,
  171. /* print the log to console. default:true */
  172. "PrintToConsole": true
  173. }
  174. }
  175. }