MCPcopy Index your code
hub / github.com/cameri/nostream / connect

Method connect

src/tor/client.ts:37–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 }
36
37 connect(): Promise<void> {
38 return new Promise((resolve, reject) => {
39 this.socket = net.connect({ host: this.host, port: this.port })
40 this.socket.once('error', reject)
41 this.socket.once('data', (data) => {
42 if (/^250/.test(data.toString())) { resolve() }
43 else { reject(new Error(`Tor auth failed: ${data}`)) }
44 })
45 this.socket.write(`AUTHENTICATE "${this.password}"\r\n`)
46 })
47 }
48
49 private isCompleteTorReply(buffer: string): boolean {
50 if (!buffer.endsWith('\r\n')) {

Callers 7

rate-limiter.tsFile · 0.80
client.spec.tsFile · 0.80
getTorClientFunction · 0.80
constructorMethod · 0.80
mainFunction · 0.80

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected