Skip to content

Commit c508e5a

Browse files
committed
listening method for http/https
1 parent 1b873d5 commit c508e5a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/proxy/proxy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ class Proxy {
233233
callback(res)
234234
}
235235

236+
listening() {
237+
const isHttp = this.config.mode === "http" || this.config.mode === "http-https"
238+
const isHttps = this.config.mode === "https" || this.config.mode === "http-https"
239+
if (!(isHttp || isHttps)) return false
240+
return (!isHttp || this.server?.listening || false) && (!isHttps || this.mitm?.httpServer?.listening || false)
241+
}
236242

237243
async start() {
238244
cacher.loadCached()

0 commit comments

Comments
 (0)