JavaScript Async/Await API for proxy service IPRoyal.com
To work with the API, you must have an account token. You can get it in your personal account on the portal.
Connect the IPRoyal module to Node.JS and create a new instance of the class.
let iproyal = require(`iproyal-wrapper`);
let token = `abc`; // IPRoyal account token
let account = new iproyal(token);
- new IPRoyal();
- account.getInfo();
- account.getSubUsers();
- account.createSubUser();
- account.getSubUserInfo();
- account.updateSubUserInfo();
- account.addSubUserTraffic();
- account.takeSubUserTraffic();
- account.getAvailableCountries();
- account.getAvailableCountrySets();
- account.getAvailableRegions();
- account.getProxyHostNames();
- account.generateUserProxyList();
let account = new iproyal(`abc`);
let subusersList = await account.getSubUsers(10);
console.log(subusersList);
console.log(await subusersList.next());
console.log(await subusersList.next());
let account = new iproyal(`abc`);
let newSubUser = await account.creteSubUser(`login`, `password`, traffic);
console.log(anewSubUser);
let newSubUser = await account.creteSubUser(`login`, `password`, traffic);
console.log(await account.addSubUserTraffic(newSubUser.id, 4));