This post is by a banned member (euhjs) - Unhide
OP 05 March, 2023 - 02:06 AM
(This post was last modified: 07 October, 2023 - 01:41 PM by euhjs. Edited 4 times in total.)
Reply
This post is by a banned member (euhjs) - Unhide
OP 05 March, 2023 - 11:02 PM
(This post was last modified: 06 March, 2023 - 07:15 AM by euhjs.)
Reply
This post is by a banned member (SirdLay) - Unhide
06 March, 2023 - 10:50 PM
Reply
This post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 01:03 AM
Reply
(06 March, 2023 - 10:50 PM)SirdLay Wrote: Show Moretried ChatGPT ?
The Bro chatgpt tell me shit like "if proxy start with Socks4, its a socks4 proxy
nothing revelent with chatgpt
This post is by a banned member (Makbodl) - Unhide
07 March, 2023 - 06:07 AM
Reply
What about?
Quote:function checkProxyProtocol(proxy) {
const [ip, port] = proxy.split(":");
return new Promise((resolve, reject) => {
const socket = require("net").connect(port, ip, () => {
const protocol = socket.remoteFamily === "IPv6" ? "socks6" : "socks4";
resolve(protocol);
socket.end();
});
socket.on("error", (err) => {
reject(err);
socket.end();
});
}).catch(() => "http");
}
This post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 07:14 AM
Reply
(07 March, 2023 - 06:07 AM)Makbodl Wrote: Show MoreWhat about?
Quote:function checkProxyProtocol(proxy) {
const [ip, port] = proxy.split(":");
return new Promise((resolve, reject) => {
const socket = require("net").connect(port, ip, () => {
const protocol = socket.remoteFamily === "IPv6" ? "socks6" : "socks4";
resolve(protocol);
socket.end();
});
socket.on("error", (err) => {
reject(err);
socket.end();
});
}).catch(() => "http");
}
That nice, but no socks5 and https
This post is by a banned member (Makbodl) - Unhide
07 March, 2023 - 07:31 AM
Reply
Try 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 post is by a banned member (euhjs) - Unhide
OP 07 March, 2023 - 07:52 AM
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
Leave Chatgpt
noone use proxy with protocole in front, if i got the proxy i would not ask how to sort it
|