Created
May 17, 2022 12:55
-
-
Save alwaisy/df56e4f282ed1b62cb5546b176361426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable comma-dangle */ | |
/* eslint-disable quotes */ | |
/* eslint-disable class-methods-use-this */ | |
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
import http from '@/services/http-common'; | |
class HproxyService { | |
getHttpProxies( | |
getproxies: string, | |
type: string, | |
timeout: number, | |
country: string, | |
anonymity: string, | |
ssl: string | |
): Promise<any> { | |
const qParams = { | |
params: { | |
request: getproxies, | |
proxytype: type, | |
timeout, | |
country, | |
anonymity, | |
ssl, | |
}, | |
}; | |
// console.log(qParams); | |
// return http.get(''); | |
/* const url = http.get('https://mapi.proxyscrape.co/', qParams); | |
console.log(qs.stringify(url), 'sjsj'); | |
console.log(url, 'sjsj'); */ | |
// return url; | |
return http.get('https://api.proxyscrape.com/', qParams); | |
} | |
amountHttpProxies( | |
amountproxies: string, | |
type: string, | |
timeout: number, | |
country: string, | |
anonymity: string, | |
ssl: string | |
): Promise<any> { | |
const qParams = { | |
params: { | |
request: amountproxies, | |
proxytype: type, | |
timeout, | |
country, | |
anonymity, | |
ssl, | |
}, | |
}; | |
// console.log(qParams); | |
return http.get('https://api.proxyscrape.com/', qParams); | |
} | |
lastUpdatedProxies(): Promise<any> { | |
return http.get('https://api.proxyscrape.com/?request=lastupdated&proxytype=http&serialkey'); | |
} | |
apiTesttt(): Promise<any> { | |
return http.get( | |
'https://api.proxyscrape.com/?request=getproxies&proxytype=http&timeout=10000&country=all&ssl=all&anonymity=all' | |
); | |
} | |
} | |
export default new HproxyService(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment