wechaty / puppet-supports

Wechaty Puppet Services (WPS)
https://wechaty.js.org/docs/puppet-services/
Apache License 2.0
32 stars 4 forks source link

WXWork: 可以挂用自己的EndPoint吗 #375

Open xuwancheng opened 6 months ago

xuwancheng commented 6 months ago

发现服务经常获取到IP地址是0.0.0.0,不稳定,所以咨询一下,我这边可以在我的服务器上提供一个代理服务,让WeChaty使用我自己的代理吗?如果可以,代码应该怎么写啊?

如果能使用自己的代理,也应该可以解决掉一些验证上面的问题,我可以在必要的时候,在我的代理服务器上登陆企业微信,以便应对腾讯的安全突击检查。该类检查包括但不限于下面的:

  1. 验证码检查
  2. 有时候企业微信强制要求在机器上登录一下Windows企业微信的
su-chang commented 6 months ago

不支持这样,不过可以试下以下做法: token对应的endpoint一般不会发生变化,建议可以做个默认值,当获取不到的时候使用默认值进行访问。

xuwancheng commented 6 months ago

哦,那可以提供一下默认值的代码写法吗?谢谢!

su-chang commented 6 months ago
const puppet = new PuppetService({
  token: 'xxxxxxx',
  endpoint: 'IP:PORT',
  tls: {
    disable: true
  },
})