ddsol / speedtest.net

node.js SpeedTest.net client module
MIT License
611 stars 124 forks source link

Test server always China #72

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hello,

This package was working a ~couple weeks ago but now it can't get the ISP information and the test server is always China Mobile even if I use the option serverId and select an Australian server still forces to China Mobile.

System: MacOS 10.14.3 Node: v11.7.0 (installed from brew) speedtest-net version: 1.4.3

Code

var speedTest = require('speedtest-net');
// Telstra Server ID
var test = speedTest({maxTime: 5000, serverId: '2628'});

test.on('data', data => {
  console.dir(data);
});

test.on('error', err => {
  console.error(err);
});

Output

{ speeds:
   { download: 1.284,
     upload: 1.768,
     originalDownload: 141373,
     originalUpload: 194016 },
  client:
   { lat: NaN,
     lon: NaN,
     isprating: NaN,
     rating: NaN,
     ispdlavg: NaN,
     ispulavg: NaN },
  server:
   { host: 'speedtest4.xj.chinamobile.com',
     lat: 81.3241,
     lon: 43.9168,
     location: 'Yili',
     country: 'China',
     cc: 'CN',
     sponsor: 'China Mobile Group XinJiang',
     distance: NaN,
     distanceMi: NaN,
     ping: 735.1,
     id: '17228' } }
ddsol commented 5 years ago

Fixed in #71

khoohuibo commented 5 years ago

I'm having this same issue as well currently. It seems to ignore whatever serverId I'm putting in.

System: Windows 10 Pro 10.0.17134 Build 17134 Node: v10.16.0 speedtest-net Version: 6.9.0

I've tried this on an online editor. maxTime and proxy works, just not serverId.

Here's the link: https://repl.it/repls/DistinctEllipticalPlans

Code

var speedTest = require('speedtest-net');

var test = speedTest({maxTime: 5000 , serverId: '712'});

test.on('data', data => {
  console.dir(data);
});

test.on('error', err => {
  console.error(err);
});

Output { speeds: { download: 233.873, upload: 32.275, originalDownload: 25756989, originalUpload: 3542003 }, client: { ip: '34.68.43.41', lat: 37.751, lon: -97.822, isp: 'Google Cloud', isprating: 3.7, rating: 0, ispdlavg: 0, ispulavg: 0, country: 'US' }, server: { host: 'speedtest.ideatek.com', lat: 38.0608, lon: -97.9298, location: 'Hutchinson, KS', country: 'United States', cc: 'US', sponsor: 'IdeaTek Telcom', distance: 35.72, distanceMi: 22.2, ping: 99.8, id: '20794' } }