Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import { createId as cuid } from '@paralleldrive/cuid2';
import { Instance, Message } from '@prisma/client';
import { createJid } from '@utils/createJid';
import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion';
import { makeProxyAgent, makeProxyAgentUndici } from '@utils/makeProxyAgent';
import { makeProxyAgent } from '@utils/makeProxyAgent';
import { getOnWhatsappCache, saveOnWhatsappCache } from '@utils/onWhatsappCache';
import { status } from '@utils/renderStatus';
import { sendTelemetry } from '@utils/sendTelemetry';
Expand Down Expand Up @@ -732,11 +732,15 @@ export class BaileysStartupService extends ChannelStartupService {
const rand = Math.floor(Math.random() * Math.floor(proxyUrls.length));
const proxyUrl = 'http://' + proxyUrls[rand];
this.logger.info('Proxy url: ' + proxyUrl);
options = { agent: makeProxyAgent(proxyUrl), fetchAgent: makeProxyAgentUndici(proxyUrl) };
// Baileys rc13 uploads media through Node's native http/https (not fetch/Undici) on the Node
// runtime, and passes fetchAgent straight to http.request as its `agent`.
options = { agent: makeProxyAgent(proxyUrl), fetchAgent: makeProxyAgent(proxyUrl) };
} catch (error) {
this.logger.error(error);
}
} else {
// Baileys rc13 uploads media through Node's native http/https (not fetch/Undici) on the Node
// runtime, and passes fetchAgent straight to http.request as its `agent`.
options = {
agent: makeProxyAgent({
host: this.localProxy.host,
Expand All @@ -745,7 +749,7 @@ export class BaileysStartupService extends ChannelStartupService {
username: this.localProxy.username,
password: this.localProxy.password,
}),
fetchAgent: makeProxyAgentUndici({
fetchAgent: makeProxyAgent({
host: this.localProxy.host,
port: this.localProxy.port,
protocol: this.localProxy.protocol,
Expand Down