Skip to content

Commit 7a57108

Browse files
committed
Moving an on.error to somewhere else for sanity.
1 parent 43fbbda commit 7a57108

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

proxy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,16 @@ function Pool(poolData){
208208
if (this.ssl){
209209
this.socket = tls.connect(this.port, this.hostname, {rejectUnauthorized: this.allowSelfSignedSSL}, ()=>{
210210
poolSocket(this.hostname);
211+
}).on('error', (err)=>{
212+
this.connect();
213+
console.warn(`${global.threadName}Socket error from ${this.hostname} ${err}`);
211214
});
212215
} else {
213216
this.socket = net.connect(this.port, this.hostname, ()=>{
214217
poolSocket(this.hostname);
218+
}).on('error', (err)=>{
219+
this.connect();
220+
console.warn(`${global.threadName}Socket error from ${this.hostname} ${err}`);
215221
});
216222
}
217223
};

0 commit comments

Comments
 (0)