Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic & API outline #23

Merged
merged 10 commits into from
Dec 4, 2023
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
[Local Peer-to-Peer](https://WICG.github.io/local-peer-to-peer/) is a Web platform API proposal for local communication between browsers without the aid of a server.

```js
let peers = await navigator.lp2p.findPeers();
let peer = peers[0];
await peer.connect();
await peer.send("Hello there!");
const conn = await new LP2PRequest(options).start();
const channel = conn.createDataChannel("chat");

channel.onopen = (event) => {
channel.send("Hi you!");
};
```

For a more in-dept overview of the proposal, please see the [Explainer](EXPLAINER.md).
Expand Down
Loading