> ## Documentation Index
> Fetch the complete documentation index at: https://baileys.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# assertPublicHttpUrl

> Throws unless url is http(s) and every address its host resolves to is public.

> **assertPublicHttpUrl**(`url`): `Promise`\<`string`>

Defined in: [src/Utils/link-preview.ts:84](https://github.com/WhiskeySockets/Baileys/blob/master/src/Utils/link-preview.ts#L84)

Throws unless `url` is http(s) and every address its host resolves to is public.
Link previews fetch URLs taken from message text and from the fetched page,
so without this a preview can reach services on the local network.

## Parameters

### url

`string`

## Returns

`Promise`\<`string`>

the first resolved address


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.