2 import { createServer, Server } from 'http'
3 import proxy from 'proxy'
4 import { randomInt } from '@shared/core-utils'
10 return new Promise<number>(res => {
11 const port = 42501 + randomInt(1, 100)
13 this.server = proxy(createServer())
14 this.server.listen(port, () => res(port))
19 if (this.server) this.server.close()
23 // ---------------------------------------------------------------------------