Skip to content

tryTcpConnectAndReadBanner

tryTcpConnectAndReadBanner(port, bannerPrefix, connectOptions?): Promise<boolean>

Defined in: net/try-tcp-connect-n-read-banner.ts:19

Connects to port, reads the first line, and returns whether it starts with bannerPrefix. Returns false on any connection or read error, or on abort.

Note: This function does not support reading multi-line banners. It only reads the first line.

number

The TCP port to connect to.

string

The expected prefix of the banner.

TcpSocketConnectOptions

Optional parameters including connection options and an abort signal.

Promise<boolean>

A promise that resolves to true if the banner starts with the specified prefix, false otherwise.