zca-js
  • ✨Bắt đầu
    • Giới thiệu
    • Ví dụ
      • Bot nhại lại người dùng
      • Bot chào mừng thành viên
  • 🔑Đăng Nhập
    • Đăng nhập với Cookie
    • Đăng nhập với QRCode
    • Đăng nhập nhiều tài khoản
    • Sử dụng Proxy
  • 🛠️API
    • acceptFriendRequest
    • addGroupDeputy
    • addReaction
    • addUserToGroup
    • blockUser
    • changeFriendAlias
    • changeGroupAvatar
    • changeGroupName
    • changeGroupOwner
    • createGroup
    • createNote
    • createPoll
    • deleteMessage
    • disperseGroup
    • editNote
    • fetchAccountInfo
    • findUser
    • getAllFriends
    • getAllGroups
    • getContext
    • getCookie
    • getGroupInfo
    • getOwnId
    • getQR
    • getStickers
    • getStickersDetail
    • getUserInfo
    • lockPoll
    • pinConversations
    • removeGroupDeputy
    • removeUserFromGroup
    • sendCard
    • sendFriendRequest
    • sendMessage
    • sendReport
    • sendSticker
    • sendVoice
    • unblockUser
    • undo
  • 📡Listener
    • message
    • reaction
    • undo
    • group_event
Powered by GitBook
On this page
  • Đối với Bun
  • Đối với NodeJS
  1. Đăng Nhập

Sử dụng Proxy

Cấu hình proxy cho zca-js

PreviousĐăng nhập nhiều tài khoảnNextacceptFriendRequest

Last updated 4 months ago

Đối với Bun

const zalo = new Zalo({
    agent: "http(s)://user:pass@host:port",
});

Đối với NodeJS

Vì native fetch của NodeJS không hỗ trợ proxy nên phải thay thế nó bằng

import { Zalo } from "zca-js";
import { HttpProxyAgent } from "http-proxy-agent";
import nodefetch from "node-fetch";

const zalo = new Zalo({
    agent: new HttpProxyAgent("http(s)://user:pass@host:port"),
    // @ts-ignore
    polyfill: nodefetch
});
🔑
node-fetch