Commit Graph

6 Commits

Author SHA1 Message Date
Jeferson Ramos
3818313161 fix: handle undefined protocol in makeProxyAgent 2025-10-27 10:40:10 -03:00
Jeferson Ramos
4a38e505f4 Esse erro acontece porque o Node.js (a partir da versão 18) usa o Undici como implementação nativa de fetch(), e o Undici não aceita mais objetos agent tradicionais (como os criados por https-proxy-agent ou socks-proxy-agent).
Ele espera objetos compatíveis com a interface moderna Dispatcher, que possuem o método dispatch().

Ou seja, o Baileys estava recebendo um tipo de agente incompatível com o novo sistema de rede do Node.

Foi criada uma nova função makeProxyAgentUndici() para gerar agentes de proxy compatíveis com o Undici, mantendo a versão antiga (makeProxyAgent()) inalterada para compatibilidade com bibliotecas como Axios.

A nova função substitui os antigos HttpsProxyAgent e SocksProxyAgent por ProxyAgent da biblioteca undici, garantindo compatibilidade total com o Baileys e com qualquer uso de fetch() moderno.
2025-10-27 10:20:34 -03:00
Henry Barreto
3390958314
feat: add support to socks proxy 2025-08-05 07:08:00 -03:00
Davidson Gomes
51c873c19e prisma orm: all endpoints ok 2024-06-06 17:01:48 -03:00
Davidson Gomes
8ece6fb998 fix: reorganization of files and folders 2024-04-12 17:13:15 -03:00
Judson Junior
5292e569d9 Remove unused dependencies and refactor proxy handling
In some tests made on the testProxy function, the `new ProxyAgent()` was not working, even adding it the IP result was the same.

I've change it to the `new HttpsProxyAgent()` and it worked.

Refactored the proxy agent to center the same function/creation the same where it is used
2024-01-21 13:54:42 -03:00