// http监听地址
this.httpAddress = '0.0.0.0';
// http监听地址
this.httpPort = 80;
// 路由
this.router = require('./router.js');
// logger
this.logger = {
logLevel: 'debug'
};
this.wsRouter = require('./wsRouter.js');
this.alphaFile = `${__dirname}/alpha.txt`;
this.appid = 'tsw1331';
this.appkey = '*****';
// https://${appid}.tswjs.org/log/view/xxx
this.isTest = true;
this.testInfo = {
"name" : "神秘商店",
"group" : "TSW",
"groupName" : "TSW团队",
"desc" : "没有人能知道这里在售卖什么",
"order" : 30,
"owner" : "TSW"
};
^C
WEIJIEZHU-MB1:TSW weijie$
WEIJIEZHU-MB1:TSW weijie$
WEIJIEZHU-MB1:TSW weijie$ node --inspect index.js
Debugger listening on ws://127.0.0.1:9229/8967afd1-1dbd-4198-9388-843aac8f9d9f
For help, see: https://nodejs.org/en/docs/inspector
2019-09-27 15:17:46.013 [INFO] [43710 cpu 0] [null] [master.js:154] start worker....
2019-09-27 15:17:46.014 [INFO] [43710 cpu 0] [null] [master.js:155] config from: /Users/weijie/dev/test/TSW/bin/proxy/../../conf/config.js
2019-09-27 15:17:46.064 [INFO] [43710 cpuX 0] [null] [http.proxy.js:76] pid:43710 createServer ok
2019-09-27 15:17:46.066 [INFO] [43710 cpuX 0] [null] [master.js:167] inspectorEnabled, start listening
2019-09-27 15:17:46.066 [INFO] [43710 cpuX 0] [null] [http.proxy.js:97] receive message, cmd: listen
2019-09-27 15:17:46.066 [INFO] [43710 cpu0 0] [null] [http.proxy.js:243] cpu: 0, beforeStartup...
2019-09-27 15:17:46.066 [INFO] [43710 cpu0 0] [null] [http.proxy.js:249] cpu: 0, listen...
2019-09-27 15:17:46.073 [INFO] [43710 cpu0 0] [null] [http.proxy.js:257] cpu: 0, listen http ok 0.0.0.0:80
2019-09-27 15:17:46.074 [INFO] [43710 cpu0 0] [null] [http.proxy.js:308] cpu: 0, listen http ok 0.0.0.0:12801
2019-09-27 15:17:46.074 [INFO] [43710 cpu0 0] [null] [http.proxy.js:265] start heartbeat
2019-09-27 15:17:46.075 [INFO] [43710 cpu0 0] [null] [http.proxy.js:284] cpu: 0, afterStartup...
2019-09-27 15:17:51.901 [DBUG] [43710 cpu0 1] [null] [http.route.js:424] GET http://127.0.0.1/
2019-09-27 15:17:51.901 [DBUG] [43710 cpu0 1] [null] [http.route.js:431] idc: sz, server ip: , tcp: 127.0.0.1:62975 > 127.0.0.1:80, client ip: 127.0.0.1, cpuUsed: 0
2019-09-27 15:17:51.901 [DBUG] [43710 cpu0 1] [null] [http.route.js:443] config.isTest is true
2019-09-27 15:17:51.903 [DBUG] [43710 cpu0 1] [null] [alphaMap.js:87] update ok
2019-09-27 15:17:51.905 [DBUG] [43710 cpu0 1] [null] [http.route.js:508] node-v10.16.3, name: null, appid: tsw1331
2019-09-27 15:17:51.906 [DBUG] [43710 cpu0 1] [null] [index.js:145] [get] done: /Users/weijie/dev/test/TSW/log/cache/h5test/test.user.list.cache, size: 54, cost: 1ms
2019-09-27 15:17:51.909 [DBUG] [43710 cpu0 1] [null] [ajax.js:294] [1] host from url: openapi.tswjs.org
2019-09-27 15:17:51.910 [DBUG] [43710 cpu0 1] [null] [ajax.js:513] [1] POST json ~ openapi.tswjs.org:443 https://openapi.tswjs.org/v1/h5test/sync
2019-09-27 15:17:51.924 [DBUG] [43710 cpu0 1] [null] [Dns.hack.js:41] dns lookup for openapi.tswjs.org
2019-09-27 15:17:51.925 [DBUG] [43710 cpu0 1] [null] [capturer.js:62] [1] POST openapi.tswjs.org:443 ~ https://openapi.tswjs.org/v1/h5test/sync
2019-09-27 15:17:51.928 [DBUG] [43710 cpu0 1] [null] [blackIpMap.js:59] config.blackIpFile is: null
2019-09-27 15:17:51.929 [DBUG] [43710 cpu0 1] [null] [logger.js:153] setKey: xxx
2019-09-27 15:17:51.930 [DBUG] [43710 cpu0 1] [null] [http.route.js:474] showLineNumber on
2019-09-27 15:17:51.930 [DBUG] [43710 cpu0 1] [null] [http.js:151] capture ServerResponse body on
2019-09-27 15:17:51.931 [DBUG] [43710 cpu0 1] [null] [http.route.js:481] response 200
2019-09-27 15:17:51.935 [DBUG] [43710 cpu0 1] [null] [http.route.js:54] clear called
2019-09-27 15:17:51.936 [DBUG] [43710 cpu0 1] [null] [http.route.js:324] finish, statusCode: 200,cost: 37ms
2019-09-27 15:17:51.937 [DBUG] [43710 cpu0 1] [null] [logReport.js:641] logType: alpha
2019-09-27 15:17:51.940 [DBUG] [43710 cpu0 1] [null] [logReport.js:671]
GET / HTTP/1.1
host: 127.0.0.1
connection: keep-alive
cache-control: max-age=0
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
sec-fetch-mode: navigate
sec-fetch-user: ?1
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
sec-fetch-site: none
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7
tsw-trace-steps: 1
response 200 {
"connection": "keep-alive",
"keep-alive": "timeout=10",
"x-powered-by": "TSW/Node.js",
"server": "TSW/1.4.1",
"cache-control": "no-cache"
}
2019-09-27 15:17:51.941 [DBUG] [43710 cpu0 1] [null] [logReport.js:204] reportCloud
2019-09-27 15:17:51.942 [DBUG] [43710 cpu0 1] [null] [logReport.js:205] report log type: alpha, key xxx
2019-09-27 15:17:51.948 [DBUG] [43710 cpu0 1] [null] [ajax.js:294] [2] host from url: openapi.tswjs.org
2019-09-27 15:17:51.949 [DBUG] [43710 cpu0 1] [null] [ajax.js:513] [2] POST json ~ openapi.tswjs.org:443 https://openapi.tswjs.org/v1/log/report
2019-09-27 15:17:51.950 [DBUG] [43710 cpu0 1] [null] [Dns.hack.js:41] dns lookup for openapi.tswjs.org
2019-09-27 15:17:51.950 [DBUG] [43710 cpu0 1] [null] [capturer.js:62] [2] POST openapi.tswjs.org:443 ~ https://openapi.tswjs.org/v1/log/report
2019-09-27 15:17:51.951 [DBUG] [43710 cpu0 1] [null] [capturer.js:73] [2] capture body on
2019-09-27 15:17:51.951 [DBUG] [43710 cpu0 1] [null] [http.js:151] capture ServerResponse body on
2019-09-27 15:17:51.954 [DBUG] [43710 cpu0 1] [null] [Dns.hack.js:62] dns lookup 30ms: openapi.tswjs.org --> 14.215.138.19
2019-09-27 15:17:51.967 [DBUG] [43710 cpu0 1] [null] [capturer.js:269] [1] dns lookup openapi.tswjs.org -> 14.215.138.19, cost 41ms
2019-09-27 15:17:51.967 [DBUG] [43710 cpu0 1] [null] [Dns.hack.js:62] dns lookup 17ms: openapi.tswjs.org --> 14.215.138.19
2019-09-27 15:17:51.967 [DBUG] [43710 cpu0 1] [null] [capturer.js:269] [2] dns lookup openapi.tswjs.org -> 14.215.138.19, cost 17ms
2019-09-27 15:17:51.976 [DBUG] [43710 cpu0 1] [null] [capturer.js:262] [1] connect 14.215.138.19:443, cost 51ms
2019-09-27 15:17:51.977 [DBUG] [43710 cpu0 1] [null] [ajax.js:573] [1] connect 14.215.138.19:443
2019-09-27 15:17:51.977 [DBUG] [43710 cpu0 1] [null] [capturer.js:262] [2] connect 14.215.138.19:443, cost 27ms
2019-09-27 15:17:51.977 [DBUG] [43710 cpu0 1] [null] [ajax.js:573] [2] connect 14.215.138.19:443
2019-09-27 15:17:52.006 [DBUG] [43710 cpu0 1] [null] [capturer.js:81] [2] send finish, total size 4041
2019-09-27 15:17:52.179 [DBUG] [43710 cpu0 2] [null] [http.route.js:424] GET http://127.0.0.1/favicon.ico
2019-09-27 15:17:52.180 [DBUG] [43710 cpu0 2] [null] [http.route.js:431] idc: sz, server ip: , tcp: 127.0.0.1:62975 > 127.0.0.1:80, client ip: 127.0.0.1, cpuUsed: 0
2019-09-27 15:17:52.180 [DBUG] [43710 cpu0 2] [null] [http.route.js:443] config.isTest is true
2019-09-27 15:17:52.180 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:508] node-v10.16.3, name: favicon.ico, appid: tsw1331
2019-09-27 15:17:52.180 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:294] [1] host from url: openapi.tswjs.org
2019-09-27 15:17:52.181 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:513] [1] POST json ~ openapi.tswjs.org:443 https://openapi.tswjs.org/v1/h5test/sync
2019-09-27 15:17:52.181 [DBUG] [43710 cpu0 2] [favicon.ico] [Dns.hack.js:41] dns lookup for openapi.tswjs.org
2019-09-27 15:17:52.182 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:62] [1] POST openapi.tswjs.org:443 ~ https://openapi.tswjs.org/v1/h5test/sync
2019-09-27 15:17:52.182 [DBUG] [43710 cpu0 2] [favicon.ico] [logger.js:153] setKey: xxx
2019-09-27 15:17:52.183 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:474] showLineNumber on
2019-09-27 15:17:52.183 [DBUG] [43710 cpu0 2] [favicon.ico] [http.js:151] capture ServerResponse body on
2019-09-27 15:17:52.183 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:481] response 200
2019-09-27 15:17:52.184 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:54] clear called
2019-09-27 15:17:52.184 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:324] finish, statusCode: 200,cost: 5ms
2019-09-27 15:17:52.184 [DBUG] [43710 cpu0 2] [favicon.ico] [logReport.js:641] logType: alpha
2019-09-27 15:17:52.185 [DBUG] [43710 cpu0 2] [favicon.ico] [logReport.js:671]
GET /favicon.ico HTTP/1.1
host: 127.0.0.1
connection: keep-alive
pragma: no-cache
cache-control: no-cache
sec-fetch-mode: no-cors
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
accept: image/webp,image/apng,image/*,*/*;q=0.8
sec-fetch-site: same-origin
referer: http://127.0.0.1/
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7
tsw-trace-steps: 1
response 200 {
"connection": "keep-alive",
"keep-alive": "timeout=10",
"x-powered-by": "TSW/Node.js",
"server": "TSW/1.4.1",
"cache-control": "no-cache"
}
2019-09-27 15:17:52.185 [DBUG] [43710 cpu0 2] [favicon.ico] [logReport.js:204] reportCloud
2019-09-27 15:17:52.185 [DBUG] [43710 cpu0 2] [favicon.ico] [logReport.js:205] report log type: alpha, key xxx
2019-09-27 15:17:52.187 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:294] [2] host from url: openapi.tswjs.org
2019-09-27 15:17:52.188 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:513] [2] POST json ~ openapi.tswjs.org:443 https://openapi.tswjs.org/v1/log/report
2019-09-27 15:17:52.188 [DBUG] [43710 cpu0 2] [favicon.ico] [Dns.hack.js:41] dns lookup for openapi.tswjs.org
2019-09-27 15:17:52.188 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:62] [2] POST openapi.tswjs.org:443 ~ https://openapi.tswjs.org/v1/log/report
2019-09-27 15:17:52.189 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:73] [2] capture body on
2019-09-27 15:17:52.189 [DBUG] [43710 cpu0 2] [favicon.ico] [http.js:151] capture ServerResponse body on
2019-09-27 15:17:52.190 [DBUG] [43710 cpu0 2] [favicon.ico] [Dns.hack.js:62] dns lookup 9ms: openapi.tswjs.org --> 14.215.138.19
2019-09-27 15:17:52.190 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:269] [1] dns lookup openapi.tswjs.org -> 14.215.138.19, cost 8ms
2019-09-27 15:17:52.190 [DBUG] [43710 cpu0 2] [favicon.ico] [Dns.hack.js:62] dns lookup 2ms: openapi.tswjs.org --> 14.215.138.19
2019-09-27 15:17:52.190 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:269] [2] dns lookup openapi.tswjs.org -> 14.215.138.19, cost 2ms
2019-09-27 15:17:52.206 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:262] [2] connect 14.215.138.19:443, cost 18ms
2019-09-27 15:17:52.206 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:573] [2] connect 14.215.138.19:443
2019-09-27 15:17:52.206 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:262] [1] connect 14.215.138.19:443, cost 24ms
2019-09-27 15:17:52.207 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:573] [1] connect 14.215.138.19:443
2019-09-27 15:17:52.219 [DBUG] [43710 cpu0 1] [null] [capturer.js:189] [1] 10.68.108.65:62981 > 14.215.138.19:443 response 200 cost:294ms gzip
2019-09-27 15:17:52.220 [DBUG] [43710 cpu0 1] [null] [ajax.js:780] [1] 14.215.138.19:443 response 200 cost:310ms gzip
2019-09-27 15:17:52.222 [DBUG] [43710 cpu0 1] [null] [capturer.js:224] [1] end size:79, receive data cost: 297ms
2019-09-27 15:17:52.223 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:81] [2] send finish, total size 3573
2019-09-27 15:17:52.224 [DBUG] [43710 cpu0 1] [null] [ajax.js:936] [1] end:102, receive data cost: 4ms
2019-09-27 15:17:52.225 [DBUG] [43710 cpu0 1] [null] [ajax.js:965] [1] done size:102
2019-09-27 15:17:52.225 [DBUG] [43710 cpu0 1] [null] [ajax.js:1016] [1] responseText:
{
"code": 0,
"data": {
"123": "alpha",
"1111111": "alpha",
"e453534534": "alpha"
}
}
2019-09-27 15:17:52.225 [DBUG] [43710 cpu0 1] [null] [ajax.js:419] [1] 返回码:0, isFail:0
2019-09-27 15:17:52.226 [DBUG] [43710 cpu0 1] [null] [index.js:80] [set] filename : /Users/weijie/dev/test/TSW/log/cache/h5test/test.user.list.cache
2019-09-27 15:17:52.226 [DBUG] [43710 cpu0 1] [null] [index.js:81] [set] dirname : /Users/weijie/dev/test/TSW/log/cache/h5test
2019-09-27 15:17:52.226 [DBUG] [43710 cpu0 1] [null] [index.js:82] [set] basename : test.user.list.cache
2019-09-27 15:17:52.227 [DBUG] [43710 cpu0 1] [null] [index.js:83] [set] randomname : test.user.list.cache.tmp.8911482326009084
2019-09-27 15:17:52.227 [DBUG] [43710 cpu0 1] [null] [is-test.js:204] syncFromCloud success.
2019-09-27 15:17:52.228 [DBUG] [43710 cpu0 1] [null] [index.js:95] [write] done: test.user.list.cache.tmp.8911482326009084, size: 54
2019-09-27 15:17:52.229 [DBUG] [43710 cpu0 1] [null] [index.js:109] [rename] done: test.user.list.cache, cost: 3ms
2019-09-27 15:17:52.345 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:189] [1] 10.68.108.65:62983 > 14.215.138.19:443 response 200 cost:163ms gzip
2019-09-27 15:17:52.345 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:780] [1] 14.215.138.19:443 response 200 cost:164ms gzip
2019-09-27 15:17:52.346 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:224] [1] end size:79, receive data cost: 164ms
2019-09-27 15:17:52.347 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:936] [1] end:102, receive data cost: 1ms
2019-09-27 15:17:52.347 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:965] [1] done size:102
2019-09-27 15:17:52.347 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:1016] [1] responseText:
{
"code": 0,
"data": {
"123": "alpha",
"1111111": "alpha",
"e453534534": "alpha"
}
}
2019-09-27 15:17:52.347 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:419] [1] 返回码:0, isFail:0
2019-09-27 15:17:52.348 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:80] [set] filename : /Users/weijie/dev/test/TSW/log/cache/h5test/test.user.list.cache
2019-09-27 15:17:52.348 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:81] [set] dirname : /Users/weijie/dev/test/TSW/log/cache/h5test
2019-09-27 15:17:52.348 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:82] [set] basename : test.user.list.cache
2019-09-27 15:17:52.348 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:83] [set] randomname : test.user.list.cache.tmp.08120765845520994
2019-09-27 15:17:52.348 [DBUG] [43710 cpu0 2] [favicon.ico] [is-test.js:204] syncFromCloud success.
2019-09-27 15:17:52.349 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:95] [write] done: test.user.list.cache.tmp.08120765845520994, size: 54
2019-09-27 15:17:52.349 [DBUG] [43710 cpu0 2] [favicon.ico] [index.js:109] [rename] done: test.user.list.cache, cost: 2ms
2019-09-27 15:17:52.710 [DBUG] [43710 cpu0 1] [null] [capturer.js:189] [2] 10.68.108.65:62982 > 14.215.138.19:443 response 200 cost:760ms
2019-09-27 15:17:52.710 [DBUG] [43710 cpu0 1] [null] [ajax.js:780] [2] 14.215.138.19:443 response 200 cost:762ms
2019-09-27 15:17:52.711 [DBUG] [43710 cpu0 1] [null] [capturer.js:224] [2] end size:39, receive data cost: 761ms
2019-09-27 15:17:52.712 [DBUG] [43710 cpu0 1] [null] [ajax.js:936] [2] end:39, receive data cost: 2ms
2019-09-27 15:17:52.712 [DBUG] [43710 cpu0 1] [null] [ajax.js:965] [2] done size:39
2019-09-27 15:17:52.712 [DBUG] [43710 cpu0 1] [null] [ajax.js:1016] [2] responseText:
{
"code": 0,
"message": "success"
}
2019-09-27 15:17:52.713 [DBUG] [43710 cpu0 1] [null] [ajax.js:419] [2] 返回码:0, isFail:0
2019-09-27 15:17:52.713 [DBUG] [43710 cpu0 1] [null] [logReport.js:238] reportCloud success.
2019-09-27 15:17:52.730 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:189] [2] 10.68.108.65:62984 > 14.215.138.19:443 response 200 cost:542ms
2019-09-27 15:17:52.730 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:780] [2] 14.215.138.19:443 response 200 cost:543ms
2019-09-27 15:17:52.730 [DBUG] [43710 cpu0 2] [favicon.ico] [capturer.js:224] [2] end size:39, receive data cost: 542ms
2019-09-27 15:17:52.731 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:936] [2] end:39, receive data cost: 1ms
2019-09-27 15:17:52.731 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:965] [2] done size:39
2019-09-27 15:17:52.731 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:1016] [2] responseText:
{
"code": 0,
"message": "success"
}
2019-09-27 15:17:52.731 [DBUG] [43710 cpu0 2] [favicon.ico] [ajax.js:419] [2] 返回码:0, isFail:0
2019-09-27 15:17:52.731 [DBUG] [43710 cpu0 2] [favicon.ico] [logReport.js:238] reportCloud success.
2019-09-27 15:17:53.957 [DBUG] [43710 cpu0 1] [null] [http.route.js:81] clearing
2019-09-27 15:17:54.189 [DBUG] [43710 cpu0 2] [favicon.ico] [http.route.js:81] clearing