hello.conf 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <tars>
  2. <application>
  3. #proxy需要的配置
  4. <client>
  5. #地址
  6. locator = TestApp.FrameworkServer.QueryObj@tcp -h 127.0.0.1 -p 11004
  7. #最大超时时间(毫秒)
  8. sync-invoke-timeout = 50000
  9. async-invoke-timeout = 60000
  10. #刷新端口时间间隔(毫秒)
  11. refresh-endpoint-interval = 100000
  12. #模块间调用[可选]
  13. stat = TestApp.FrameworkServer.StatObj
  14. #发送队列长度
  15. sendqueuelimit = 1000000
  16. #异步回调队列个数限制
  17. asyncqueuecap = 1000000
  18. #网络异步回调线程个数
  19. asyncthread = 3
  20. #网络线程个数
  21. netthread = 2
  22. #合并回调线程和网络线程(以网络线程个数为准)
  23. mergenetasync = 0
  24. #模块名称
  25. modulename = TestApp.HelloServer
  26. #server crt
  27. ca = PROJECT_PATH/certs/server.crt
  28. #can be empty
  29. cert = PROJECT_PATH/certs/client.crt
  30. #can be empty
  31. key = PROJECT_PATH/certs/client.key
  32. <TestApp.HelloServer.AuthObj>
  33. #auth access key
  34. accesskey = tars-test-user
  35. #auth secret key
  36. secretkey = 123456
  37. </TestApp.HelloServer.AuthObj>
  38. <TestApp.HelloServer.SSL1Obj>
  39. #server crt
  40. ca = PROJECT_PATH/certs/server1.crt
  41. #can be empty
  42. # cert = PROJECT_PATH/certs/client1.crt
  43. #can be empty
  44. # key = PROJECT_PATH/certs/client1.key
  45. </TestApp.HelloServer.SSL1Obj>
  46. <TestApp.HelloServer.SSL2Obj>
  47. #server crt
  48. ca = PROJECT_PATH/certs/server1.crt
  49. #can be empty
  50. cert = PROJECT_PATH/certs/client1.crt
  51. #can be empty
  52. key = PROJECT_PATH/certs/client1.key
  53. </TestApp.HelloServer.SSL2Obj>
  54. <TestApp.HelloServer.SSL3Obj>
  55. #auth access key
  56. accesskey = tars-test-user
  57. #auth secret key
  58. secretkey = 123456
  59. #server crt
  60. ca = PROJECT_PATH/certs/server1.crt
  61. #can be empty
  62. cert = PROJECT_PATH/certs/client1.crt
  63. #can be empty
  64. key = PROJECT_PATH/certs/client1.key
  65. </TestApp.HelloServer.SSL3Obj>
  66. </client>
  67. #定义所有绑定的IP
  68. <server>
  69. start_output = ERROR
  70. closecout = 0
  71. #应用名称
  72. app = TestApp
  73. #服务名称
  74. server = HelloServer
  75. #服务的数据目录,可执行文件,配置文件等
  76. basepath = .
  77. datapath = .
  78. #日志路径
  79. logpath = .
  80. #网络线程个数
  81. netthread = 1
  82. #合并网络和业务线程(以网络线程个数为准)
  83. mergenetimp = 0
  84. opencoroutine = 0
  85. loglevel=TARS
  86. #本地管理套接字[可选]
  87. local = tcp -h 127.0.0.1 -p 18001 -t 10000
  88. #配置中心的地址[可选]
  89. config = TestApp.FrameworkServer.ConfigObj
  90. #配置中心的地址[可选]
  91. # notify = tars.tarsconfig.NotifyObj
  92. #远程LogServer[可选]
  93. log = TestApp.FrameworkServer.LogObj
  94. # manuallisten = 1
  95. #client crt, it can be empty when verifyclient is 0
  96. # ca = PROJECT_PATH/certs/client.crt
  97. cert = PROJECT_PATH/certs/server.crt
  98. key = PROJECT_PATH/certs/server.key
  99. ciphers =
  100. #default is 0
  101. verifyclient = 1
  102. #配置绑定端口
  103. <HelloAdapter>
  104. #ip:port:timeout
  105. #endpoint = tcp -h harbor.tars.com -p 45460 -t 60000
  106. endpoint = tcp -h 127.0.0.1 -p 25460 -t 10000
  107. #endpoint = udp -h * -p 45460 -t 60000
  108. #允许的IP地址
  109. allow =
  110. #最大连接数
  111. maxconns = 4096
  112. #当前线程个数
  113. threads = 5
  114. #处理对象
  115. servant = TestApp.HelloServer.HelloObj
  116. #队列最大包个数
  117. queuecap = 1000000
  118. </HelloAdapter>
  119. <TransAdapter>
  120. #ip:port:timeout
  121. endpoint = tcp -h 127.0.0.1 -p 15460 -t 60000
  122. #允许的IP地址
  123. allow =
  124. #最大连接数
  125. maxconns = 4096
  126. #当前线程个数
  127. threads = 5
  128. #处理对象
  129. servant = TestApp.HelloServer.TransObj
  130. #队列最大包个数
  131. queuecap = 1000000
  132. </TransAdapter>
  133. <TransDstAdapter>
  134. #ip:port:timeout
  135. endpoint = tcp -h 127.0.0.1 -p 15760 -t 60000
  136. #允许的IP地址
  137. allow =
  138. #最大连接数
  139. maxconns = 4096
  140. #当前线程个数
  141. threads = 5
  142. #处理对象
  143. servant = TestApp.HelloServer.TransDstObj
  144. #队列最大包个数
  145. queuecap = 1000000
  146. </TransDstAdapter>
  147. <TransWupAdapter>
  148. #ip:port:timeout
  149. endpoint = tcp -h 127.0.0.1 -p 15461 -t 60000
  150. #允许的IP地址
  151. allow =
  152. #最大连接数
  153. maxconns = 4096
  154. #当前线程个数
  155. threads = 5
  156. #处理对象
  157. servant = TestApp.HelloServer.TransWupObj
  158. #队列最大包个数
  159. queuecap = 1000000
  160. protocol = not-tars
  161. </TransWupAdapter>
  162. <HttpAdapter>
  163. #ip:port:timeout
  164. endpoint = tcp -h 127.0.0.1 -p 8080 -t 60000
  165. #允许的IP地址
  166. allow =
  167. #最大连接数
  168. maxconns = 4096
  169. #当前线程个数
  170. threads = 5
  171. #处理对象
  172. servant = TestApp.HelloServer.HttpObj
  173. #队列最大包个数
  174. queuecap = 1000000
  175. protocol = not-tars
  176. </HttpAdapter>
  177. <HttpsAdapter>
  178. #ip:port:timeout
  179. endpoint = ssl -h 127.0.0.1 -p 8081 -t 60000
  180. #允许的IP地址
  181. allow =
  182. #最大连接数
  183. maxconns = 4096
  184. #当前线程个数
  185. threads = 5
  186. #处理对象
  187. servant = TestApp.HelloServer.HttpsObj
  188. #队列最大包个数
  189. queuecap = 1000000
  190. protocol = not-tars
  191. </HttpsAdapter>
  192. <Ipv6Adapter>
  193. #ip:port:timeout
  194. #endpoint = tcp -h fe80::9e5c:8eff:fe95:5cda%enp3s0 -p 25460 -t 10000
  195. #endpoint = tcp -h fe80::9e5c:8eff:fe95:5cda%enp3s0 -p 25460 -t 10000
  196. endpoint = tcp -h ::1 -p 25460 -t 60000
  197. #允许的IP地址
  198. allow =
  199. #最大连接数
  200. maxconns = 4096
  201. #当前线程个数
  202. threads = 5
  203. #处理对象
  204. servant = TestApp.HelloServer.Ipv6Obj
  205. #队列最大包个数
  206. queuecap = 1000000
  207. </Ipv6Adapter>
  208. <AuthObjAdapter>
  209. #ip:port:timeout
  210. endpoint = tcp -h 127.0.0.1 -p 9016 -t 60000 -e 1
  211. #allow ip
  212. allow =
  213. #max connection num
  214. maxconns = 4096
  215. #imp thread num
  216. threads = 5
  217. #servant
  218. servant = TestApp.HelloServer.AuthObj
  219. #queue capacity
  220. queuecap = 1000000
  221. #tars protocol
  222. protocol = tars
  223. accesskey=tars-test-user
  224. secretkey=123456
  225. </AuthObjAdapter>
  226. <SSLHelloAdapter>
  227. #ip:port:timeout
  228. endpoint = ssl -h 127.0.0.1 -p 9005 -t 60000
  229. #allow ip
  230. allow =
  231. #max connection num
  232. maxconns = 4096
  233. #imp thread num
  234. threads = 5
  235. #servant
  236. servant = TestApp.HelloServer.SSLObj
  237. #queue capacity
  238. queuecap = 1000000
  239. #tars protocol
  240. protocol = tars
  241. </SSLHelloAdapter>
  242. <SSLHello1Adapter>
  243. #ip:port:timeout
  244. endpoint = ssl -h 127.0.0.1 -p 9006 -t 60000
  245. #allow ip
  246. allow =
  247. #max connection num
  248. maxconns = 4096
  249. #imp thread num
  250. threads = 5
  251. #servant
  252. servant = TestApp.HelloServer.SSL1Obj
  253. #queue capacity
  254. queuecap = 1000000
  255. #tars protocol
  256. protocol = tars
  257. # ca = PROJECT_PATH/certs/client1.crt
  258. cert = PROJECT_PATH/certs/server1.crt
  259. key = PROJECT_PATH/certs/server1.key
  260. #default is 0
  261. verifyclient = 0
  262. ciphers =
  263. </SSLHello1Adapter>
  264. <SSLHello2Adapter>
  265. #ip:port:timeout
  266. endpoint = ssl -h 127.0.0.1 -p 9007 -t 60000
  267. #allow ip
  268. allow =
  269. #max connection num
  270. maxconns = 4096
  271. #imp thread num
  272. threads = 5
  273. #servant
  274. servant = TestApp.HelloServer.SSL2Obj
  275. #queue capacity
  276. queuecap = 1000000
  277. #tars protocol
  278. protocol = tars
  279. ca = PROJECT_PATH/certs/client1.crt
  280. cert = PROJECT_PATH/certs/server1.crt
  281. key = PROJECT_PATH/certs/server1.key
  282. #default is 0
  283. verifyclient = 1
  284. ciphers =
  285. </SSLHello2Adapter>
  286. <SSLHello3Adapter>
  287. #ip:port:timeout
  288. endpoint = ssl -h 127.0.0.1 -p 9008 -t 60000 -e 1
  289. #allow ip
  290. allow =
  291. #max connection num
  292. maxconns = 4096
  293. #imp thread num
  294. threads = 5
  295. #servant
  296. servant = TestApp.HelloServer.SSL3Obj
  297. #queue capacity
  298. queuecap = 1000000
  299. #tars protocol
  300. protocol = tars
  301. #auth access key
  302. accesskey = tars-test-user
  303. #auth secret key
  304. secretkey = 123456
  305. ca = PROJECT_PATH/certs/client1.crt
  306. cert = PROJECT_PATH/certs/server1.crt
  307. key = PROJECT_PATH/certs/server1.key
  308. #default is 0
  309. verifyclient = 1
  310. ciphers =
  311. </SSLHello3Adapter>
  312. <CustomAdapter>
  313. #ip:port:timeout
  314. endpoint = tcp -h 127.0.0.1 -p 9400 -t 60000
  315. #allow ip
  316. allow =
  317. #max connection num
  318. maxconns = 4096
  319. #imp thread num
  320. threads = 5
  321. #servant
  322. servant = TestApp.HelloServer.CustomObj
  323. #queue capacity
  324. queuecap = 1000000
  325. #tars protocol
  326. protocol = not_tars
  327. </CustomAdapter>
  328. <UdpObjAdapter>
  329. #ip:port:timeout
  330. endpoint = udp -h 127.0.0.1 -p 9016 -t 60000 -e 1
  331. #allow ip
  332. allow =
  333. #max connection num
  334. maxconns = 4096
  335. #imp thread num
  336. threads = 5
  337. #servant
  338. servant = TestApp.HelloServer.UdpObj
  339. #queue capacity
  340. queuecap = 1000000
  341. #tars protocol
  342. protocol = tars
  343. </UdpObjAdapter>
  344. <UdpIpv6Adapter>
  345. #ip:port:timeout
  346. endpoint = udp -h ::1 -p 25460 -t 60000
  347. #允许的IP地址
  348. allow =
  349. #最大连接数
  350. maxconns = 4096
  351. #当前线程个数
  352. threads = 5
  353. #处理对象
  354. servant = TestApp.HelloServer.UdpIpv6Obj
  355. #队列最大包个数
  356. queuecap = 1000000
  357. </UdpIpv6Adapter>
  358. <PushAdapter>
  359. #ip:port:timeout
  360. endpoint = tcp -h 127.0.0.1 -p 9300 -t 60000
  361. #allow ip
  362. allow =
  363. #max connection num
  364. maxconns = 4096
  365. #imp thread num
  366. threads = 5
  367. #servant
  368. servant = TestApp.HelloServer.PushObj
  369. #queue capacity
  370. queuecap = 1000000
  371. #tars protocol
  372. protocol = not_tars
  373. </PushAdapter>
  374. <HelloTimeoutAdapter>
  375. #ip:port:timeout
  376. endpoint = tcp -h 127.0.0.1 -p 25860 -t 5000
  377. #允许的IP地址
  378. allow =
  379. #最大连接数
  380. maxconns = 4096
  381. #当前线程个数
  382. threads = 1
  383. #处理对象
  384. servant = TestApp.HelloServer.HelloTimeoutObj
  385. #队列最大包个数
  386. queuecap = 1000000
  387. #protocol = not-tars
  388. </HelloTimeoutAdapter>
  389. <HelloNoTimeoutAdapter>
  390. #ip:port:timeout
  391. endpoint = tcp -h 127.0.0.1 -p 26460 -t 0
  392. #允许的IP地址
  393. allow =
  394. #最大连接数
  395. maxconns = 4096
  396. #当前线程个数
  397. threads = 1
  398. #处理对象
  399. servant = TestApp.HelloServer.HelloNoTimeoutObj
  400. #队列最大包个数
  401. queuecap = 1000000
  402. #protocol = not-tars
  403. </HelloNoTimeoutAdapter>
  404. </server>
  405. </application>
  406. </tars>