Package Exports
- zencf
- zencf/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zencf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🚀 zencf
Klien API untuk Cloudflare Bypass
Bypass Cloudflare WAF & Turnstile tanpa browser headless.
zencf adalah klien ringan untuk mengatasi tantangan Cloudflare seperti WAF dan Turnstile tanpa perlu menjalankan browser headless.
💾 Instalasi
Menggunakan npm
npm install zencf
Menggunakan yarn
yarn add zencf📋 Penggunaan
Modul ini mendukung CommonJS (require) dan ES Modules (import).
🧱 CommonJS Example
const { zencf } = require('zencf');
async function getSession() {
try {
const session = await zencf.wafSession(
'https://example.com/protected',
'host:port'
);
console.log('Cookies:', session.cookies);
console.log('User-Agent:', session.headers['User-Agent']);
} catch (error) {
console.error('Gagal mendapatkan WAF Session:', error.message);
}
}
getSession();📦 ES Modules Example (Static Import)
import { zencf } from 'zencf';
(async () => {
try {
const result = await zencf.turnstileMin(
'https://forms.com/login',
'0x4AAAAAAAT-yE...'
);
console.log('Token Turnstile:', result.token);
} catch (error) {
console.error('Gagal:', error.message);
}
})();⚙️ ES Modules Example (Dynamic Import)
async function runDynamicScraper() {
const zencfModule = await import('zencf');
const zencf =
zencfModule.zencf ||
(zencfModule.default && zencfModule.default.zencf);
try {
const result = await zencf.turnstileMin(
'https://forms.com/login',
'0x4AAAAAAAT-yE...'
);
console.log('Token Dynamic Import:', result.token);
} catch (error) {
console.error('Gagal menjalankan dynamic import:', error.message);
}
}
runDynamicScraper();🧭 API Reference
Semua fungsi bersifat async dan akan melempar Error jika gagal.
1️⃣ zencf.wafSession(url, proxy?)
Mengambil cookies dan headers untuk melewati Cloudflare WAF.
Parameter
Nama Tipe Wajib Deskripsi
url string Ya URL target WAF proxy string Tidak Proxy opsional (user:pass@host:port)
const { zencf } = require('zencf');
async function getSession() {
const session = await zencf.wafSession(
'https://example.com/protected',
'host:port'
);
console.log('Cookies:', session.cookies);
console.log('Headers:', session.headers);
}
getSession();
```javascript
---
### 2️⃣ zencf.turnstileMin(url, siteKey, proxy?)
Menyelesaikan challenge Cloudflare Turnstile dengan mode cepat.
Parameter
Nama Tipe Wajib Deskripsi
url string Ya URL halaman
siteKey string Ya Site Key Turnstile
proxy string Tidak Proxy opsional
```javascript
const { zencf } = require('zencf');
async function solveTurnstile() {
const result = await zencf.turnstileMin(
'https://forms.com/login',
'0x4AAAAAAAT-yE...',
'host:port'
);
console.log('Token Turnstile Min:', result.token);
}
solveTurnstile();3️⃣ zencf.turnstileMax(url, proxy?)
Mode maksimum dengan simulasi interaksi pengguna.
Parameter
Nama Tipe Wajib Deskripsi
url string Ya URL target proxy string Tidak Proxy opsional
4️⃣ zencf.source(url, proxy?)
Mengambil HTML yang sudah di-render JavaScript.
const { zencf } = require('zencf');
async function getSource() {
const result = await zencf.source('https://spa-website.com/');
console.log(
'HTML Source:',
result.source.substring(0, 200) + '...'
);
}
getSource();⚠️ Penanganan Error
try {
const token = await zencf.turnstileMin(url, siteKey, proxy);
console.log('Token:', token);
} catch (err) {
console.error('zencf error:', err.message);
}🔒 Catatan Keamanan
Token Turnstile harus diverifikasi di server-side
Hindari logging token sensitif di produksi
Gunakan proxy dari sumber tepercaya
🧠 Tips
turnstileMin → cepat
turnstileMax → proteksi ketat
wafSession → tahap awal scraping
source → situs SPA
📜 Lisensi
Mengikuti ketentuan pada package.json atau repositori resmi proyek