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
JavaScript
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);
}
})();