Creates an instance of the Client class.
The host address of the proxy server.
The port number of the proxy server.
The local port number.
The local host address.
The incoming server port number.
The reconnect interval in milliseconds.
The incoming server port number.
Indicates if the client is in the process of reconnecting.
The local host address.
The local port number.
The host address of the proxy server.
The port number of the proxy server.
The proxy server socket connection.
An instance of the proxy socket handler, responsible for managing socket communications. Null if no handler is assigned.
The reconnect interval in milliseconds.
Establishes a connection to App2 and sets up event listeners for the socket.
The unique name associated with the App2 connection.
A promise that resolves with the established App2 socket.
data
: Forwards received data to the proxy socket handler.drain
: Resumes the socket after backpressure is alleviated.end
: Cleans up resources when the connection ends.close
: Cleans up resources when the connection is closed.error
: Logs errors and cleans up resources.Writes buffered data for the specified socket name to the proxy server in chunks.
If the proxy socket's writable buffer reaches its highWaterMark, the method waits
for the drain
event before continuing.
The unique name of the connection for which data is being written.
A promise that resolves when all buffered data has been sent.
drain
event if the writable buffer becomes full.drain
event.Buffers are mapped by socket names:
{
"socketName1": <Buffer ...>,
"socketName2": <Buffer ...>
}
A class representing the client-side of the proxy system.