Skip to content

Commit

Permalink
Text changes, removed example text
Browse files Browse the repository at this point in the history
  • Loading branch information
AtibQur committed Dec 21, 2024
1 parent e5560f7 commit d5373cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion sites/cheerpx/src/content/docs/11-guides/Networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const cx = await CheerpX.Linux.create({
What is happening here?

- [authKey]: A string containing an authentication key for registering pre-authenticated users or devices. You can generate one [here](https://login.tailscale.com/admin/settings/keys).
- [controlUrl]: The Tailscale control plane URL for identity verification. This is only needed if you are [self-hosting Tailscale](/docs/guides/Networking#self-hosting-headscale).
- [controlUrl]: The URL of the control plane, which coordinates network access and identity verification. When [self-hosting Tailscale](/docs/guides/Networking#self-hosting-headscale), you need to provide the control plane URL of your Headscale server. By default, the main Tailscale control plane is used.
- [stateUpdateCb]: A required callback function that monitors and reports changes in network status.
- [netmapUpdateCb]: A required callback function that provides updates on the network map, enabling access to the list of devices for the network.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ const cx = await CheerpX.Linux.create({
});
```

In this example, the `authKey` is included in the `networkInterface` object to enable authentication for the CheerpX instance.

### `controlUrl`

```ts
Expand All @@ -114,8 +112,6 @@ const cx = await CheerpX.Linux.create({
});
```

Here, the `controlUrl` is used to point the CheerpX instance to a custom self-hosted server.

### `loginUrlCb`

```ts
Expand All @@ -139,8 +135,6 @@ function loginUrlCb(url) {
}
```

The `loginUrlCb` provides the user with a login URL for authentication. It logs the URL and opens it in a new tab or window. You can also adapt it to display the URL within your app or handle it differently as needed.

### stateUpdateCb

```ts
Expand All @@ -164,15 +158,13 @@ function stateUpdateCb(state) {
}
```

This example checks if the `state` indicates a "connected" status (`state = 6`) and logs "Connected" when the connection is established.

### netmapUpdateCb

```ts
netmapUpdateCb?: (map: any) => void;
```

The `netmapUpdateCb` is a callback triggered whenever the network configuration updates. It provides details about the current network configuration.
The `netmapUpdateCb` is a callback that runs whenever the network configuration updates. It provides details about the current network configuration.

Example:

Expand All @@ -188,6 +180,4 @@ function netmapUpdateCb(map) {
}
```

In this example, the `netmapUpdateCb` logs the current IP address (`map.self.addresses[0]`) whenever the network configuration changes.

[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

0 comments on commit d5373cf

Please sign in to comment.