Module

std/http/server.ts

Deno standard library
Go to Latest
function _parseAddrFromStr
import { _parseAddrFromStr } from "https://deno.land/std@0.107.0/http/server.ts";

Parse an address from a string.

Throws a TypeError when the address is invalid.

import { _parseAddrFromStr } from "https://deno.land/std@0.107.0/http/server.ts";

const addr = "::1:8000";
const listenOptions = _parseAddrFromStr(addr);

Parameters

addr: string

The address string to parse.

optional
defaultPort = [UNSUPPORTED]

Default port when not included in the address string.

Returns

The parsed address.