# agentWsUrl

<!-- https://uncage.vercel.app/docs/api/agent/functions/agentwsurl/ -->

```ts
function agentWsUrl(hubUrl): string;
```

Defined in: agent/src/device.ts:35

`ws(s)://…/agent` for a hub base URL; refuses ws:// to anything but loopback.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `hubUrl` | `string` |

## Returns

`string`
