Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
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.