This post is by a banned member (Makbodl) - Unhide
07 March, 2023 - 08:19 AM
Reply
The easiest way to achieve what you want since you want a proxy sorter, is to look at the port, because you can't get it from the domain (its just impossible). So forget about node.js, python is easier.
Quote:def get_proxy_type(proxy):
port = int(proxy.split(':')[1])
if port == 80 or port == 8080:
return 'http'
elif port == 443:
return 'https'
elif port >= 1080 and port <= 1085:
return 'socks{}'.format(port - 1080)
else:
return 'unknown'
This post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 08:23 AM
Reply
(07 March, 2023 - 08:19 AM)Makbodl Wrote: Show MoreThe easiest way to achieve what you want since you want a proxy sorter, is to look at the port, because you can't get it from the domain (its just impossible). So forget about node.js, python is easier.
Quote:def get_proxy_type(proxy):
port = int(proxy.split(':')[1])
if port == 80 or port == 8080:
return 'http'
elif port == 443:
return 'https'
elif port >= 1080 and port <= 1085:
return 'socks{}'.format(port - 1080)
else:
return 'unknown' pls stop replying if u just copy paste from google
This post is by a banned member (Makbodl) - Unhide
This post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 09:27 AM
Reply
(07 March, 2023 - 08:28 AM)Makbodl Wrote: Show More"Ungratefulness is a sad reflection of a person's character, but it should never stop us from extending kindness and compassion to others.." So I highly recommend that you learn some node.js or even python to achieve your goal so you will see the code from a different angle. Here are some good tutorials from Mosh:
https://www.youtube.com/watch?v=TlB_eWDSMt4
https://www.youtube.com/watch?v=_uQrJ0TkZlc&vl=en
Cheers. useless reply as usual
This post is by a banned member (Napakf) - Unhide
07 March, 2023 - 09:55 AM
(This post was last modified: 07 March, 2023 - 09:56 AM by Napakf. Edited 1 time in total.)
Reply
(07 March, 2023 - 07:31 AM)Makbodl Wrote: Show MoreTry this:
Quote:function checkProxyProtocol(proxyList) {
for (let proxy of proxyList) {
if (proxy.startsWith("http://")) {
return "HTTP";
} else if (proxy.startsWith("socks4://")) {
return "SOCKS4";
} else if (proxy.startsWith("socks5://")) {
return "SOCKS5";
} else if (proxy.startsWith("https://")) {
return "HTTPS";
}
}
return "Unknown";
}
let proxies = ["http://192.168.0.1:8080", "socks4://192.168.0.2:1080", "socks5://192.168.0.3:1080", "https://192.168.0.4:443"]; // You can add your list inside the array or you can call it from a text file next to your JS file
let protocol = checkProxyProtocol(proxies);
console.log(protocol); // Output: SOCKS4
This is too basic, there are apps (open source) to sort and even test the proxies for you if that what you are looking for.
This post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 06:28 PM
Reply
(07 March, 2023 - 09:55 AM)Napakf Wrote: Show More (07 March, 2023 - 07:31 AM)Makbodl Wrote: Show MoreTry this:
Quote:function checkProxyProtocol(proxyList) {
for (let proxy of proxyList) {
if (proxy.startsWith("http://")) {
return "HTTP";
} else if (proxy.startsWith("socks4://")) {
return "SOCKS4";
} else if (proxy.startsWith("socks5://")) {
return "SOCKS5";
} else if (proxy.startsWith("https://")) {
return "HTTPS";
}
}
return "Unknown";
}
let proxies = ["http://192.168.0.1:8080", "socks4://192.168.0.2:1080", "socks5://192.168.0.3:1080", "https://192.168.0.4:443"]; // You can add your list inside the array or you can call it from a text file next to your JS file
let protocol = checkProxyProtocol(proxies);
console.log(protocol); // Output: SOCKS4
This is too basic, there are apps (open source) to sort and even test the proxies for you if that what you are looking for.
can u share it ?
This post is by a banned member (euhjs) - Unhide
OP 08 March, 2023 - 10:07 PM
Reply
This post is by a banned member (euhjs) - Unhide
OP 08 March, 2023 - 10:07 PM
Reply
|