connect method

Future<TcpConn> connect(
  1. ConnectOptions options
)

Connects to the hostname (default is "127.0.0.1") and port on the named transport (default is "tcp"), and resolves to the connection (Conn).

const conn1 = await Deno.connect({ port: 80 });
const conn2 = await Deno.connect({ hostname: "192.0.2.1", port: 80 });
const conn3 = await Deno.connect({ hostname: "[2001:db8::1]", port: 80 });
const conn4 = await Deno.connect({ hostname: "golang.org", port: 80, transport: "tcp" });

Requires allow-net permission for "tcp".

Implementation

_i2.Future<_i4.TcpConn> connect(_i4.ConnectOptions options) =>
    _i3.promiseToFuture(_i3.callMethod(
      this,
      'connect',
      [options],
    ));