mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Added fetch agent
This commit is contained in:
@@ -377,7 +377,7 @@ export class WAConnection extends EventEmitter {
|
||||
method,
|
||||
body,
|
||||
headers: { Origin: DEFAULT_ORIGIN, ...(headers || {}) },
|
||||
agent: agent || this.connectOptions.agent
|
||||
agent: agent || this.connectOptions.fetchAgent
|
||||
})
|
||||
)
|
||||
generateMessageTag (longTag: boolean = false) {
|
||||
|
||||
@@ -84,8 +84,10 @@ export type WAConnectOptions = {
|
||||
/** max time for the phone to respond to a connectivity test */
|
||||
phoneResponseTime?: number
|
||||
connectCooldownMs?: number
|
||||
/** agent which can be used for proxying connections */
|
||||
/** agent used for WS connections */
|
||||
agent?: Agent
|
||||
/** agent used for fetch requests -- uploading/downloading media */
|
||||
fetchAgent?: Agent
|
||||
}
|
||||
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
||||
export const URL_REGEX = /[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)?/gi
|
||||
|
||||
Reference in New Issue
Block a user