remove test.js

This commit is contained in:
Bilal
2020-08-20 16:06:13 +03:00
parent 638476a6bf
commit 0d03b82c4b

29
test.js
View File

@@ -1,29 +0,0 @@
const axios = require('axios').default
const SocksProxyAgent = require('socks-proxy-agent');
const HttpsProxyAgent = require('https-proxy-agent');
const socksProxyOptions = `socks5://114.103.105.105:4216`; // your sock5 host and port;
const httpsProxyOptions = 'https://92.119.222.1:8080';
const socksAgent = new SocksProxyAgent(socksProxyOptions);
const httpAgent = new HttpsProxyAgent(httpsProxyOptions);
axios.interceptors.request.use( x => {
// to avoid overwriting if another interceptor
// already defined the same object (meta)
x.meta = x.meta || {}
x.meta.requestStartedAt = new Date().getTime();
return x;
});
axios.interceptors.response.use(x => {
x.responseTime = new Date().getTime() - x.config.meta.requestStartedAt;
return x;
});
axios({
httpsAgent: socksAgent,
url:'https://api.ipify.org/?format=json'
}).then(r => {
console.log(r.responseTime);
})