Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion impit-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impit = { path="../impit" }
rustls = { version="0.23.16" }
tokio = { version="1.41.1", features = ["full"] }
h2 = "0.4.7"
reqwest = "0.12.9"
reqwest = { rev="74e6f84152a48f00106fe72e0bd2cfc1a4254c93", git="https://github.com/seanmonstar/reqwest" }
tokio-stream = "0.1.17"
bytes = "1.9.0"

Expand Down
24 changes: 23 additions & 1 deletion impit-node/test/basics.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import http from 'http';
import { test, describe, expect, beforeAll, afterAll } from 'vitest';

import { HttpMethod, Impit, Browser } from '../index.wrapper.js';
import type { Server } from 'net';
import type { AddressInfo, Server } from 'net';
import { routes, runProxyServer, runServer } from './mock.server.js';

import { CookieJar } from 'tough-cookie';
Expand Down Expand Up @@ -164,6 +165,27 @@ describe.each([
expect(json).toHaveProperty('origin');
});

test('proxy with incomplete authentication works', async () => {
let proxyHit = false;
const proxy = http.createServer((req, res) => {
proxyHit = true;
res.writeHead(200);
res.end('OK');
});
await new Promise((r) => proxy.listen(0, '127.0.0.1', r));
const proxyPort = (proxy.address() as AddressInfo)?.port;

const impit = new Impit({
proxyUrl: `http://user:@127.0.0.1:${proxyPort}`,
});

const resp = await impit.fetch('http://example.com/'); // the URL doesn't matter, request should go through the proxy
expect(await resp.text()).toBe('OK');
expect(proxyHit).toBe(true);

proxy.close();
});

test('impit accepts custom cookie jars', async (t) => {
const cookieJar = new CookieJar();
cookieJar.setCookieSync('preset-cookie=123; Path=/', getHttpBinUrl('/cookies/'));
Expand Down
2 changes: 1 addition & 1 deletion impit-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impit = { path="../impit" }
rustls = { version="0.23.16" }
tokio = { version="1.41.1", features = ["full"] }
h2 = "0.4.7"
reqwest = "0.12.9"
reqwest = { rev="74e6f84152a48f00106fe72e0bd2cfc1a4254c93", git="https://github.com/seanmonstar/reqwest" }
tokio-stream = "0.1.17"
bytes = "1.9.0"
pyo3 = { version = "0.27", features = ["extension-module", "auto-initialize"] }
Expand Down
4 changes: 2 additions & 2 deletions impit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ hickory-proto = "0.25.1"
log = "0.4.22"
mime = "0.3.17"
num-bigint = "0.4.6"
reqwest = { version = "0.12.9", features = ["json", "gzip", "brotli", "zstd", "deflate", "rustls-tls", "http3", "cookies", "stream", "socks"] }
reqwest = { rev="74e6f84152a48f00106fe72e0bd2cfc1a4254c93", git="https://github.com/seanmonstar/reqwest", features = ["json", "gzip", "brotli", "zstd", "deflate", "rustls-tls", "http3", "cookies", "stream", "socks"] }
rustls = { version="0.23.16", features=["impit"] }
scraper = "0.24.0"
thiserror = "2.0.12"
tokio = { version="1.40.0", features = ["full"] }
url = "2.5.2"
webpki-roots = "0.26.6"
hyper-util = "0.1.16"
hyper-util = "0.1.18"
hyper = "1.7.0"
Loading