appsettings.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. {
  2. "Sers": {
  3. /* 通讯层配置 */
  4. "CL": {
  5. /* 共用配置,子项共用,覆写子项未指定的配置 */
  6. "Config": {
  7. /* 后台处理消息的线程个数(单位个,默认2) */
  8. "workThreadCount": 2,
  9. /* 请求超时时间(单位ms,默认60000) */
  10. "requestTimeoutMs": 60000,
  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. /* (x.2) config */
  56. /* 服务端 host地址。例如: "127.0.0.1"、"sers.com" */
  57. "host": "127.0.0.1",
  58. /* 服务端 监听端口号。例如: 4501 */
  59. "port": 4501
  60. },
  61. {
  62. // Socket.ThreadWait
  63. /* (x.1) type - ThreadWait */
  64. /* the class of builder in assemblyFile */
  65. //"className": "Sers.CL.Socket.ThreadWait.OrganizeClientBuilder",
  66. /* (x.2) config */
  67. /* 服务端 host地址。例如: "127.0.0.1"、"sers.com" */
  68. "host": "127.0.0.1",
  69. /* 服务端 监听端口号。例如: 4501 */
  70. "port": 4501
  71. },
  72. {
  73. // Zmq.ThreadWait
  74. /* (x.1) type */
  75. /* 在此Assembly中查找Builder */
  76. "assemblyFile": "Sers.CL.ClrZmq.ThreadWait.dll",
  77. /* the class of Builder in assemblyFile */
  78. //"className": "Sers.CL.ClrZmq.ThreadWait.OrganizeClientBuilder",
  79. /* (x.2) config */
  80. /* 地址。例如: "tcp://127.0.0.1:4502" 、 "ipc://4502" */
  81. "endpoint": "tcp://127.0.0.1:4502"
  82. },
  83. {
  84. // WebSocket
  85. /* (x.1) type - WebSocket */
  86. /* 在此Assembly中查找builder */
  87. "assemblyFile": "Sers.CL.WebSocket.dll",
  88. /* the class of builder in assemblyFile */
  89. //"className": "Sers.CL.WebSocket.OrganizeClientBuilder",
  90. /* (x.2) config */
  91. /* 服务端地址(默认为 "ws://127.0.0.1:4503") */
  92. "host": "ws://127.0.0.1:4503"
  93. },
  94. {
  95. // Zmq.FullDuplex
  96. /* (x.1) type */
  97. /* 在此Assembly中查找Builder */
  98. "assemblyFile": "Sers.CL.Zmq.FullDuplex.dll",
  99. /* the class of Builder in assemblyFile */
  100. //"className": "Sers.CL.Zmq.FullDuplex.OrganizeClientBuilder",
  101. /* (x.2) config */
  102. /* 地址。例如: "tcp://127.0.0.1:4504" 、 "ipc://4504" */
  103. "endpoint": "tcp://127.0.0.1:4504"
  104. },
  105. {
  106. // Ipc.SharedMemory
  107. /* (x.1) type - Ipc.SharedMemory */
  108. /* 在此Assembly中查找Builder */
  109. "assemblyFile": "Sers.CL.Ipc.SharedMemory.dll",
  110. /* the class of Builder in assemblyFile */
  111. //"className": "Sers.CL.Ipc.SharedMemory.OrganizeClientBuilder",
  112. /* (x.2) config */
  113. /* 共享内存名称。例如: "ipcTest" */
  114. "name": "ipcForRobot"
  115. }
  116. ]
  117. },
  118. /* LocalApiService 配置,可不指定 */
  119. "LocalApiService": {
  120. /* 后台服务的线程个数(单位个,默认0,代表不开启服务) */
  121. "workThreadCount": 1,
  122. /* 静态文件映射器。映射站点静态文件,可多个,可不指定 */
  123. "staticFiles": [
  124. {
  125. /* api路由前缀,例如 "/demo/ui/*" */
  126. "route": "/_robot_/*",
  127. /* api描述,静态文件描述 */
  128. "apiName": "robot站点静态文件",
  129. /* 静态文件路径。可为相对路径或绝对路径。若为空或空字符串则为默认路径(wwwroot)。demo:"wwwroot/demo" */
  130. "rootPath": "wwwroot/_robot_",
  131. /* 静态文件类型映射配置的文件路径。可为相对路径或绝对路径。例如"contentTypeMap.json"。若不指定(或指定的文件不存在)则不指定文件类型映射配置 */
  132. "contentTypeMapFile": "contentTypeMap.json",
  133. /* 回应静态文件时额外添加的http回应头。可不指定。 */
  134. "responseHeaders": {
  135. //设置浏览器静态文件缓存3600秒
  136. "Cache-Control": "public,max-age=3600"
  137. }
  138. }
  139. ]
  140. },
  141. /* ServiceStation配置,可不指定 */
  142. "ServiceStation": {
  143. /* serviceStation站点信息 */
  144. "serviceStationInfo": {
  145. "serviceStationName": "Robot"
  146. }
  147. }
  148. },
  149. /* Vit工具配置,可不指定 */
  150. "Vit": {
  151. /* 日志配置,可不指定 */
  152. "Logger": {
  153. /* print the log to console. default:false */
  154. "PrintToConsole": true
  155. }
  156. }
  157. }