fix: Re-added the option to use proxy agent forn non-mobile api (#148)

This commit is contained in:
Edgard Lorraine Messias
2023-06-15 21:46:43 -03:00
committed by GitHub
parent aa9872b039
commit 54f8215eef
9 changed files with 177 additions and 78 deletions

View File

@@ -5,7 +5,6 @@ import { KeyPair, SignedKeyPair, SocketConfig } from '../Types'
import { aesEncryptGCM, Curve, md5 } from '../Utils/crypto'
import { jidEncode } from '../WABinary'
import { makeBusinessSocket } from './business'
import { MobileSocket } from './mobile-socket'
function urlencode(str: string) {
return str.replace(/-/g, '%2d').replace(/_/g, '%5f').replace(/~/g, '%7e')
@@ -33,10 +32,6 @@ export const makeRegistrationSocket = (config: SocketConfig) => {
sock.authState.creds.registered = true
sock.ev.emit('creds.update', sock.authState.creds)
if(sock.ws instanceof MobileSocket) {
sock.ws.connect()
}
return result
}