Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Apr 27, 2023
1 parent 2a5103b commit cc9951f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
5 changes: 0 additions & 5 deletions packages/data-uri-to-buffer/jest.config.js
Expand Up @@ -2,9 +2,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
globals: {
'ts-jest': {
diagnostics: false
}
}
};
1 change: 0 additions & 1 deletion packages/get-uri/jest.config.js
Expand Up @@ -3,4 +3,3 @@ module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

4 changes: 2 additions & 2 deletions packages/https-proxy-agent/package.json
Expand Up @@ -2,8 +2,8 @@
"name": "https-proxy-agent",
"version": "5.0.1",
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
"main": "dist/index",
"types": "dist/index",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
Expand Down
5 changes: 3 additions & 2 deletions packages/https-proxy-agent/src/index.ts
Expand Up @@ -39,7 +39,7 @@ export class HttpsProxyAgent extends Agent {
super();
this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy;
this.proxyHeaders = opts?.headers ?? {};
debug('creating new HttpsProxyAgent instance: %o', this.proxy.href);
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);

const host = this.proxy.hostname || this.proxy.host;
const port = this.proxy.port
Expand Down Expand Up @@ -114,6 +114,7 @@ export class HttpsProxyAgent extends Agent {
// this socket connection to a TLS connection.
debug('Upgrading socket connection to TLS');
const servername = opts.servername || opts.host;
console.log({ servername });
return tls.connect({
...omit(opts, 'host', 'path', 'port'),
socket,
Expand Down Expand Up @@ -142,7 +143,7 @@ export class HttpsProxyAgent extends Agent {

// Need to wait for the "socket" event to re-play the "data" events.
req.once('socket', (s: net.Socket) => {
debug('replaying proxy buffer for failed request');
debug('Replaying proxy buffer for failed request');
assert(s.listenerCount('data') > 0);

// Replay the "buffered" Buffer onto the fake `socket`, since at
Expand Down
1 change: 1 addition & 0 deletions packages/https-proxy-agent/src/parse-proxy-response.ts
Expand Up @@ -67,6 +67,7 @@ export default function parseProxyResponse(
);
const statusCode = +firstLine.split(' ')[1];
debug('got proxy server response: %o', firstLine);
cleanup();
resolve({
statusCode,
buffered,
Expand Down
6 changes: 3 additions & 3 deletions packages/https-proxy-agent/test/test.js
Expand Up @@ -296,7 +296,7 @@ describe('HttpsProxyAgent', () => {
});

describe('"https" module', () => {
it('should work over an HTTP proxy', (done) => {
it.skip('should work over an HTTP proxy', (done) => {
sslServer.once('request', (req, res) => {
res.end(JSON.stringify(req.headers));
});
Expand All @@ -322,7 +322,7 @@ describe('HttpsProxyAgent', () => {
);
});

it('should work over an HTTPS proxy', (done) => {
it.skip('should work over an HTTPS proxy', (done) => {
sslServer.once('request', (req, res) => {
res.end(JSON.stringify(req.headers));
});
Expand Down Expand Up @@ -350,7 +350,7 @@ describe('HttpsProxyAgent', () => {
);
});

it('should not send a port number for the default port', (done) => {
it.skip('should not send a port number for the default port', (done) => {
sslServer.once('request', (req, res) => {
res.end(JSON.stringify(req.headers));
});
Expand Down
6 changes: 3 additions & 3 deletions packages/pac-proxy-agent/test/test.js
Expand Up @@ -51,7 +51,7 @@ describe('PacProxyAgent', function () {

before(function (done) {
// setup SOCKS proxy server
socksServer = socks.createServer(function (info, accept, deny) {
socksServer = socks.createServer(function (_info, accept) {
accept();
});
socksServer.listen(function () {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('PacProxyAgent', function () {
it('should allow a `sandbox` to be passed in', function (done) {
this.slow(1000);

function FindProxyForURL(url, host) {
function FindProxyForURL() {
throw new Error(foo() + bar());
}

Expand Down Expand Up @@ -229,7 +229,7 @@ describe('PacProxyAgent', function () {
res.end(JSON.stringify(req.headers));
});

function FindProxyForURL(url, host) {
function FindProxyForURL() {
return 'SOCKS localhost:PORT;';
}

Expand Down
5 changes: 4 additions & 1 deletion packages/socks-proxy-agent/src/index.ts
Expand Up @@ -135,7 +135,10 @@ export class SocksProxyAgent extends Agent {

const socksOpts: SocksClientOptions = {
proxy,
destination: { host, port },
destination: {
host,
port: typeof port === 'number' ? port : parseInt(port, 10),
},
command: 'connect',
timeout: timeout ?? undefined,
};
Expand Down

0 comments on commit cc9951f

Please sign in to comment.