| 82 | private _client: SocksConnectionClient; |
| 83 | |
| 84 | constructor(uid: string, socket: net.Socket, client: SocksConnectionClient) { |
| 85 | this._uid = uid; |
| 86 | this._socket = socket; |
| 87 | this._client = client; |
| 88 | this._boundOnData = this._onData.bind(this); |
| 89 | socket.on('data', this._boundOnData); |
| 90 | socket.on('close', () => this._onClose()); |
| 91 | socket.on('end', () => this._onClose()); |
| 92 | socket.on('error', () => this._onClose()); |
| 93 | this._run().catch(() => this._socket.end()); |
| 94 | } |
| 95 | |
| 96 | async _run() { |
| 97 | assert(await this._authenticate()); |