Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@puppeteer/browsers

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@puppeteer/browsers - npm Package Compare versions

Comparing version 1.4.4 to 1.4.5

21

lib/cjs/httpUtil.js

@@ -46,3 +46,6 @@ "use strict";

const url_1 = require("url");
const proxy_agent_1 = require("proxy-agent");
const http_proxy_agent_1 = require("http-proxy-agent");
const https_proxy_agent_1 = require("https-proxy-agent");
const proxy_from_env_1 = require("proxy-from-env");
const socks_proxy_agent_1 = require("socks-proxy-agent");
function headHttpRequest(url) {

@@ -60,2 +63,16 @@ return new Promise(resolve => {

function httpRequest(url, method, response, keepAlive = true) {
const proxy = (0, proxy_from_env_1.getProxyForUrl)(url.toString());
let agent;
if (proxy) {
const proxyUrl = new url_1.URL(proxy);
if (proxyUrl.protocol === 'http:') {
agent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl);
}
else if (proxyUrl.protocol === 'https:') {
agent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl);
}
else if (proxyUrl.protocol.startsWith('socks')) {
agent = new socks_proxy_agent_1.SocksProxyAgent(proxyUrl);
}
}
const options = {

@@ -69,3 +86,3 @@ protocol: url.protocol,

auth: (0, url_1.urlToHttpOptions)(url).auth,
agent: new proxy_agent_1.ProxyAgent(),
agent,
};

@@ -72,0 +89,0 @@ const requestCallback = (res) => {

@@ -20,3 +20,6 @@ /**

import { URL, urlToHttpOptions } from 'url';
import { ProxyAgent } from 'proxy-agent';
import { HttpProxyAgent } from 'http-proxy-agent';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { getProxyForUrl } from 'proxy-from-env';
import { SocksProxyAgent } from 'socks-proxy-agent';
export function headHttpRequest(url) {

@@ -33,2 +36,16 @@ return new Promise(resolve => {

export function httpRequest(url, method, response, keepAlive = true) {
const proxy = getProxyForUrl(url.toString());
let agent;
if (proxy) {
const proxyUrl = new URL(proxy);
if (proxyUrl.protocol === 'http:') {
agent = new HttpProxyAgent(proxyUrl);
}
else if (proxyUrl.protocol === 'https:') {
agent = new HttpsProxyAgent(proxyUrl);
}
else if (proxyUrl.protocol.startsWith('socks')) {
agent = new SocksProxyAgent(proxyUrl);
}
}
const options = {

@@ -42,3 +59,3 @@ protocol: url.protocol,

auth: urlToHttpOptions(url).auth,
agent: new ProxyAgent(),
agent,
};

@@ -45,0 +62,0 @@ const requestCallback = (res) => {

8

package.json
{
"name": "@puppeteer/browsers",
"version": "1.4.4",
"version": "1.4.5",
"description": "Download and launch browsers",

@@ -103,4 +103,7 @@ "scripts": {

"extract-zip": "2.0.1",
"http-proxy-agent": "7.0.0",
"https-proxy-agent": "7.0.1",
"progress": "2.0.3",
"proxy-agent": "6.2.1",
"proxy-from-env": "1.1.0",
"socks-proxy-agent": "8.0.1",
"tar-fs": "3.0.4",

@@ -112,2 +115,3 @@ "unbzip2-stream": "1.4.3",

"@types/node": "^16.11.7",
"@types/proxy-from-env": "1.0.1",
"@types/yargs": "17.0.22"

@@ -114,0 +118,0 @@ },

@@ -22,3 +22,6 @@ /**

import {ProxyAgent} from 'proxy-agent';
import {HttpProxyAgent} from 'http-proxy-agent';
import {HttpsProxyAgent} from 'https-proxy-agent';
import {getProxyForUrl} from 'proxy-from-env';
import {SocksProxyAgent} from 'socks-proxy-agent';

@@ -47,2 +50,16 @@ export function headHttpRequest(url: URL): Promise<boolean> {

): http.ClientRequest {
const proxy = getProxyForUrl(url.toString());
let agent: http.Agent | undefined;
if (proxy) {
const proxyUrl = new URL(proxy);
if (proxyUrl.protocol === 'http:') {
agent = new HttpProxyAgent(proxyUrl);
} else if (proxyUrl.protocol === 'https:') {
agent = new HttpsProxyAgent(proxyUrl);
} else if (proxyUrl.protocol.startsWith('socks')) {
agent = new SocksProxyAgent(proxyUrl);
}
}
const options: http.RequestOptions = {

@@ -56,3 +73,3 @@ protocol: url.protocol,

auth: urlToHttpOptions(url).auth,
agent: new ProxyAgent(),
agent,
};

@@ -59,0 +76,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc