QA & Automation · November 26, 2026 · 6 min read · Ler em português
Proxy in Baileys and WPPConnect
How to set up a proxy in WhatsApp bots built with Baileys and WPPConnect, why a datacenter IP is a risk, one proxy per number and care with IP rotation.
Baileys and WPPConnect are widely used libraries for automating WhatsApp in Node.js. Both connect to WhatsApp from the server where the bot runs, and that server almost always has a datacenter IP. To WhatsApp, a Brazilian number connecting from a foreign datacenter is an odd signal. A Brazilian Mobile Proxy gives each number a network origin consistent with an ordinary user.
A proxy doesn't make acceptable what WhatsApp's rules forbid. Mass messaging people who didn't ask for it still leads to bans with any IP. The proxy fixes the connection's origin, not the behavior.
Baileys
In Baileys, the proxy is passed as a connection agent when creating the socket. For an HTTP proxy, use an agent like https-proxy-agent with the URL http://username:password@host:port; for SOCKS5, socks-proxy-agent with socks5://username:password@host:port. Pass the agent both for the main connection and for the agent used to download media, so everything exits through the same IP.
WPPConnect
WPPConnect drives a browser, so the proxy goes in as a Chrome argument (--proxy-server=http://host:port) in the browser options. Since that argument doesn't carry username and password, the simplest way is IP authorization in the panel, allowing the bot server's IP.
One proxy per number
Each WhatsApp number should have its own Mobile Proxy. Several numbers exiting through the same IP form an easy-to-link group: if one is reported, the others enter the same review.
IP rotation and sessions
A WhatsApp session stays connected for hours. Seeing the IP change every few minutes isn't how an ordinary user behaves. On the Monthly plan, lengthen the automatic rotation interval to several hours or turn it off, and rotate the IP only when you need to. If the connection drops during a rotation, Baileys and WPPConnect reconnect; handle that event in code instead of restarting the bot.
Ready to run on a dedicated Mobile Proxy?