简体   繁体   English

是否可以在 Docker 容器中使用whatsapp web?

[英]Is it possible to use whatsapp web in a Docker container?

I have created a microservice infrastructure to send messages to customers via WhatsApp.我创建了一个微服务基础架构,通过 WhatsApp 向客户发送消息。 A microservice is there to forward the message via REST API to a notification provider who then sends the WhatsApp.一个微服务通过 REST API 将消息转发给通知提供者,然后通知提供者发送 WhatsApp。 For the service to work, I need WhatsApp Web.为了使服务正常工作,我需要 WhatsApp Web。 If she starts my microservice and wants to send a message, it works even if I am logged in via WhatsApp Web.如果她启动我的微服务并想发送一条消息,即使我通过 WhatsApp Web 登录它也能正常工作。

Now to the problem:现在解决问题:

I packed the microservice in Docker Container so that I can start it as a web service at Azure or AWS.我将微服务打包在 Docker 容器中,以便我可以在 Azure 或 AWS 上将其作为 web 服务启动。 However, sending the WhatsApp message doesn't work because I don't have an interface in the Docker container to WhatsApp Web.但是,发送 WhatsApp 消息不起作用,因为我在 Docker 容器中没有到 WhatsApp Web 的接口。 Is there a way to create the interface in the Docker container to WhatsApp Web without having to scan a QR code?有没有办法在 Docker 容器中创建与 WhatsApp Web 的接口而无需扫描二维码?

Is there a way to create the interface in the Docker container to WhatsApp Web without having to scan a QR code?有没有办法在 Docker 容器中创建与 WhatsApp Web 的接口而无需扫描二维码?

The answer is NO答案是否定

But you can run Chrome inside docker and use CDP to control it.但是您可以在 docker 中运行 Chrome 并使用 CDP 来控制它。 That said, you can access QRCode via VNC and scan.也就是说,您可以通过 VNC 访问 QRCode 并进行扫描。 Or you can create something like venom-bot to wrap it.或者你可以创建类似venom-bot的东西来包装它。

Karate is a Java test Automation Tool that uses CDP to achieve this.空手道是一个 Java 测试自动化工具,它使用 CDP 来实现这一点。

Look this:看看这个:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM