(data: Buffer)
| 116 | } |
| 117 | |
| 118 | const onData = (data: Buffer) => { |
| 119 | buf += data.toString() |
| 120 | if (!this.isCompleteTorReply(buf)) { |
| 121 | return |
| 122 | } |
| 123 | |
| 124 | cleanup() |
| 125 | if (/^250/.test(buf)) { resolve(buf) } |
| 126 | else { reject(new Error(buf.trim())) } |
| 127 | } |
| 128 | |
| 129 | socket.on('data', onData) |
| 130 | socket.on('error', onError) |
nothing calls this directly
no test coverage detected