UNPKG

windscribe-proxy-sdk

Version:

Unofficial Windscribe proxy SDK with custom SNI support, bulk testing, and session management for Node.js

43 lines (32 loc) โ€ข 1.37 kB
const { WindscribeSDK } = require('../index'); const STATE_FILE = 'session.json'; (async () => { try { console.log('๐Ÿ” Discovering best servers...'); const sdk = new WindscribeSDK({ enableLogging: false }); sdk.loadState(STATE_FILE); console.log('๐Ÿ“ Searching for US servers with <300ms latency...'); const bestServers = await sdk.findBestServers({ country: 'US', maxLatency: 300, testCount: 5, excludeFailed: true }); console.log('\n๐Ÿ† Top 5 servers found:'); bestServers.forEach((server, index) => { const star = index === 0 ? 'โญ' : ''; console.log(` ${index + 1}. ${server.hostname} (${server.latency}ms) ${star}`); }); if (bestServers.length > 0) { const bestServer = bestServers[0]; console.log(`\n๐Ÿงช Testing best server: ${bestServer.hostname}`); const testResult = await sdk.testServerLatency(bestServer.hostname, 3); console.log(`๐Ÿ“Š Latency test: ${testResult.avgLatency}ms (${testResult.rounds} rounds)`); } console.log('\n๐Ÿ’พ Results cached for 10 minutes'); } catch (e) { console.error('โŒ Server discovery failed:', e.message); } })();