@applitools/eg-socks5-proxy-server
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -20,2 +20,3 @@ /// <reference types="node" /> | ||
listen: (...args: any[]) => net.Server; | ||
listenAsync: (port: number, host?: string) => Promise<void>; | ||
close: (...args: any[]) => net.Server; | ||
@@ -22,0 +23,0 @@ getConnections: (cb: (error: Error | null, count: number) => void) => void; |
@@ -55,2 +55,13 @@ "use strict"; | ||
this.listen = (...args) => this.server.listen(...args); | ||
this.listenAsync = (port, host = '127.0.0.1') => { | ||
const promise = new Promise((resolve, reject) => { | ||
try { | ||
this.server.listen(port, host, resolve); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} | ||
}); | ||
return promise; | ||
}; | ||
this.close = (...args) => { | ||
@@ -57,0 +68,0 @@ this.syncDestinationSocketInterval && clearInterval(this.syncDestinationSocketInterval); |
{ | ||
"name": "@applitools/eg-socks5-proxy-server", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -385,2 +385,14 @@ import { | ||
public listen = (...args: any[]) => this.server.listen(...args) | ||
public listenAsync = (port: number, host = '127.0.0.1') => { | ||
const promise = new Promise<void>((resolve, reject) => { | ||
try { | ||
this.server.listen(port, host, resolve) | ||
} catch (e) { | ||
reject(e) | ||
} | ||
}) | ||
return promise | ||
} | ||
public close = (...args: any[]) => { | ||
@@ -387,0 +399,0 @@ this.syncDestinationSocketInterval && clearInterval(this.syncDestinationSocketInterval) |
@@ -25,2 +25,3 @@ import {Socket, Server} from 'net' | ||
listen: (...args: any[]) => void | ||
listenAsync: (port: number, host?: string) => void | ||
close: (...args: any[]) => void | ||
@@ -27,0 +28,0 @@ getConnections: (cb: (error: Error | null, count: number) => void) => void |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
103620
1917