Skip to content

Commit ca68c61

Browse files
trying to find the hang
1 parent 6d67c91 commit ca68c61

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/HttpsProxySocket.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { createProxyAgent } from './createProxyAgent';
33
import { setServername } from './utils/setServername';
44
import { parseOptions } from './utils/parseOptions';
55

6-
import { debug as nodeDebug } from 'util';
7-
8-
const debug = nodeDebug('https-proxy');
6+
// import { debug as nodeDebug } from 'util';
7+
//
8+
// const debug = nodeDebug('https-proxy');
99

1010
export interface HttpsProxyConfig extends tls.ConnectionOptions {
1111
headers?: { [key: string]: string };
@@ -38,7 +38,7 @@ export class HttpsProxySocket {
3838
if (!options) {
3939
throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
4040
}
41-
debug('creating new HttpsProxyAgent instance: %o', sanitizedOptions);
41+
console.log('creating new HttpsProxyAgent instance: %o', sanitizedOptions);
4242

4343
this.proxyConfig = proxyConfig || {};
4444
this.proxy = sanitizedOptions as tls.ConnectionOptions;
@@ -87,7 +87,7 @@ export class HttpsProxySocket {
8787
let buffersLength = 0;
8888

8989
function read() {
90-
var b = socket.read();
90+
const b = socket.read();
9191
if (b) {
9292
ondata(b);
9393
} else {
@@ -104,11 +104,11 @@ export class HttpsProxySocket {
104104
}
105105

106106
function onclose(err: any) {
107-
debug('onclose had error %o', err);
107+
console.log('onclose had error %o', err);
108108
}
109109

110110
function onend() {
111-
debug('onend');
111+
console.log('onend');
112112
}
113113

114114
function onerror(err: any) {
@@ -129,7 +129,7 @@ export class HttpsProxySocket {
129129

130130
if (str.indexOf(END_OF_HEADERS) < 0) {
131131
// keep buffering
132-
debug('have not received end of HTTP headers yet...');
132+
console.log('have not received end of HTTP headers yet...');
133133
if (socket.readable) {
134134
read();
135135
} else {
@@ -140,7 +140,7 @@ export class HttpsProxySocket {
140140

141141
const firstLine = str.substring(0, str.indexOf('\r\n'));
142142
const statusCode = parseInt(firstLine.split(' ')[1], 10);
143-
debug('got proxy server response: %o', firstLine);
143+
console.log('got proxy server response: %o', firstLine);
144144

145145
if (200 == statusCode) {
146146
// 200 Connected status code!

src/mongoPatch.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ interface Config {
99
proxy: string;
1010
}
1111

12-
const originalCreateConnection = socks.SocksClient.createConnection;
13-
1412
/**
1513
* The patch should be called before instantiating the MongoClient
1614
* @param config - The configuration for the proxy

0 commit comments

Comments
 (0)