# Interface: Mesh

Defined in: [packages/core/src/network/mesh.ts:69](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L69)

## Methods

### iceServers()

```ts
iceServers(): Promise<readonly RTCIceServer[]>;
```

Defined in: [packages/core/src/network/mesh.ts:81](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L81)

The ICE servers for a WebRTC connection of the application's own: the configured ones, and fresh TURN from a relay

#### Returns

`Promise`\<readonly `RTCIceServer`[]\>

***

### join()

```ts
join(room, auth?): NetworkManager;
```

Defined in: [packages/core/src/network/mesh.ts:77](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L77)

A space's share of the mesh: the peers that proved themselves in its room.
`connect()` enters the room and `disconnect()` leaves it.

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `room` | `string` | The space's room — a hash of its id |
| `auth?` | `MeshAuth` \| `null` | What peers must prove here; null lets anyone in the room in |

#### Returns

[`NetworkManager`](https://minca.dev/api/core/interfaces/NetworkManager.md)

***

### reconnect()

```ts
reconnect(): void;
```

Defined in: [packages/core/src/network/mesh.ts:87](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L87)

Tries every relay that is waiting to reconnect, now

#### Returns

`void`

***

### status()

```ts
status(): MeshStatus;
```

Defined in: [packages/core/src/network/mesh.ts:83](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L83)

The relays, the connections open and the ones being made, as they are now

#### Returns

[`MeshStatus`](https://minca.dev/api/core/interfaces/MeshStatus.md)

***

### subscribe()

```ts
subscribe(listener): () => void;
```

Defined in: [packages/core/src/network/mesh.ts:85](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L85)

Hears every change to `status()`; returns a function that stops it

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `listener` | () => `void` |

#### Returns

() => `void`

***

### useRelays()

```ts
useRelays(room, relays): void;
```

Defined in: [packages/core/src/network/mesh.ts:79](https://github.com/leifriksheim/minca/blob/main/core/src/network/mesh.ts#L79)

The relays a room's space names as its own (`sys.relays`), joined for that room on top of the mesh's

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `room` | `string` |
| `relays` | readonly `string`[] |

#### Returns

`void`
