Skip to content

Commit 2ca876e

Browse files
authored
Merge pull request #175 from BuilderIO/revert-170-proxy
Revert "feat: proxy support"
2 parents 73dfaef + 586ea5a commit 2ca876e

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# [1.5.0](https://github.com/BuilderIO/gpt-crawler/compare/v1.4.0...v1.5.0) (2024-07-05)
22

3+
34
### Features
45

5-
- git clone depth limit in docker ([87767db](https://github.com/BuilderIO/gpt-crawler/commit/87767dbda99b3259d44ec2c02dceb3a59bb2ca3c))
6+
* git clone depth limit in docker ([87767db](https://github.com/BuilderIO/gpt-crawler/commit/87767dbda99b3259d44ec2c02dceb3a59bb2ca3c))
67

78
# [1.4.0](https://github.com/BuilderIO/gpt-crawler/compare/v1.3.0...v1.4.0) (2024-01-15)
89

config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ export const defaultConfig: Config = {
66
maxPagesToCrawl: 50,
77
outputFileName: "output.json",
88
maxTokens: 2000000,
9-
// proxyUrls: ["http://username:password@proxyserver:port"], // socks5://username:password@proxyserver:port
109
};

src/config.ts

-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ export const configSchema = z.object({
8585
* @example 5000
8686
*/
8787
maxTokens: z.number().int().positive().optional(),
88-
/** Optional proxy server
89-
* @example ['http://username:password@proxyserver:port', 'socks5://username:password@proxyserver:port']
90-
*/
91-
proxyUrls: z.array(z.string()).optional(),
9288
});
9389

9490
export type Config = z.infer<typeof configSchema>;

src/core.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// For more information, see https://crawlee.dev/
2-
import {
3-
Configuration,
4-
PlaywrightCrawler,
5-
ProxyConfiguration,
6-
downloadListOfUrls,
7-
} from "crawlee";
2+
import { Configuration, PlaywrightCrawler, downloadListOfUrls } from "crawlee";
83
import { readFile, writeFile } from "fs/promises";
94
import { glob } from "glob";
105
import { Config, configSchema } from "./config.js";
@@ -59,13 +54,8 @@ export async function crawl(config: Config) {
5954
if (process.env.NO_CRAWL !== "true") {
6055
// PlaywrightCrawler crawls the web using a headless
6156
// browser controlled by the Playwright library.
62-
const proxyConfiguration = new ProxyConfiguration({
63-
proxyUrls: config.proxyUrls,
64-
});
65-
6657
crawler = new PlaywrightCrawler(
6758
{
68-
proxyConfiguration,
6959
// Use the requestHandler to process each of the crawled pages.
7060
async requestHandler({ request, page, enqueueLinks, log, pushData }) {
7161
const title = await page.title();

0 commit comments

Comments
 (0)