appsettings.json 7.0 KB

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