set WECHATY_PUPPET="wechaty-puppet-wechat4u" set WECHATY_TOKEN="d6e8b1c7-6fcd-4e32-b3f6-8d1e73388458" # set WECHATY_TOKEN=$(curl -s https://www.uuidgenerator.net/api/version4)
set WECHATY_PUPPET_SERVICE_TOKEN="insecure_d6e8b1c7-6fcd-4e32-b3f6-8d1e73388458" # set WECHATY_PUPPET_SERVICE_TOKEN="insecure_$(curl -s https://www.uuidgenerator.net/api/version4)"
set WECHATY_LOG="verbose" set WECHATY_PUPPET_SERVER_PORT="25000" set WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER=true
func OnScan(ctx *wechaty.Context) { os.exit(0) --------------------------------------- ➜ time go run test.go 2022/04/13 22:09:40 PuppetService Start() 2022/04/13 22:09:42 PuppetService onGrpcStreamEvent({type:EVENT_TYPE_HEARTBEAT payload:{"data":"Wechaty Puppet gRPC stream connect successfully"}}) 2022/04/13 22:09:42 PuppetService onGrpcStreamEvent({type:EVENT_TYPE_SCAN payload:{"qrcode":"https://login.weixin.qq.com/l/IeJ_ESMXqQ==","status":2}}) go run test.go 0.46s user 0.32s system 27% cpu 2.895 total
TypeScript
1 2 3 4 5 6 7 8
function onScan(payload: PUPPET.payloads.EventScan) { return process.exit(0); --------------------------------------- time cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node examples/1.ts Puppet Version: 0.0.0<1.18.3> Please wait... I'm trying to login in... cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node examples/1.t 0.40s user 0.13s system 54% cpu 0.975 total
因为大部分兄弟的微信是不能登录网页版而选的 XP 协议,所以我想说,XP 协议需要 Hook 微信进程,TypeScript 将需要更多的时间