Skip to content

Proxy with protocol "socks4"and "socks5" cant be used on version 0.5.4#265

Description

@amoguslmao

馃摑 Summary

Version 0.5.4 cannot use proxies with the socks4 or socks5 protocol and throws an error, while version 0.5.3 works normally and responds properly.

馃摉 Description

I used NPM to install the latest version of Impit with the command:

npm install impit

After installing, I started using the package normally. However, after a while, I noticed that I couldn鈥檛 use proxies with the socks4 or socks5 protocol anymore. I double-checked multiple times to make sure the proxy was still alive and not dead.

When I used a proxy with that protocol, I got an error like this:

PS C:\Users\admin\Documents\Coding\impit-test> node .
[Error: impit error: The internal HTTP library has thrown an error:
reqwest::Error {
    kind: Request,
    url: "https://backend.wplace.live/me",
    source: hyper_util::client::legacy::Error(
        Connect,
        SocksConnect(
            Inner(
                ConnectError(
                    "tcp connect error",
                    113.169.74.21:10012,
                    Os {
                        code: 10060,
                        kind: TimedOut,
                        message: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.",     
                    },
                ),
            ),
        ),
    ),
}] {
  code: 'GenericFailure'
}

At that time, my code looked like this:

import { Impit } from "impit";
import { CookieJar } from "tough-cookie";

const COOKIE = "deleted the cookie";

try {
	const cookie = new CookieJar();
	await cookie.setCookie(`j=${COOKIE}; Path=/`, "https://backend.wplace.live");

	const impit = new Impit({
		browser: "chrome",
		proxyUrl: "socks4://113.169.74.21:10012",
		timeout: 30000,
		ignoreTlsErrors: true,
		cookieJar: cookie
	});

	const res = await impit.fetch("https://backend.wplace.live/me");

	console.log(await res.json());
}
catch(err) {
	console.error(err);
}
Image

After repeatedly checking and asking GPT as well as searching on Google, and even looking through StackOverflow, I couldn鈥檛 find any information related to the Impit package 馃槬. Then I remembered there was a repo also using this package that worked fine. I went into their package.json and saw that they were on version 0.5.3. I followed and installed version 0.5.3 like this:

npm install impit@0.5.3

After installing, I tried using the same proxy again and... surprisingly! Impit fetched successfully without throwing any errors.

I鈥檓 not sure if anyone has already opened an issue like this, so please excuse me if this is a duplicate.
i used gpt to translate the issues to english

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions