|
1 | | -#How to run p2p sample |
2 | | -###1st step: Run Woogeen p2p server |
3 | | -To run the server, you need to install node and npm, then change directory into server, and install all modules listed as dependencies in package.json by using command **`npm install`** . |
4 | | -After dependencies successfully installed, you can run the peerserver.js by using command **`node peerserver.js`**. It will listen on port 8085/8096. |
5 | | -###2nd step: Deploy p2p sample page and sdk on web server |
| 1 | +# How to run p2p sample |
| 2 | + |
| 3 | +## Step 1: Run p2p server |
| 4 | +To run the server, you need to install node and npm, then change into the [owt-server-p2p](https://github.com/open-webrtc-toolkit/owt-server-p2p) source directory, and install all modules listed as dependencies in package.json by using command `npm install` . |
| 5 | +After the dependencies are successfully installed, you can run the peer server by using the command `node peerserver.js`. It will listen on ports 8095/8096. |
| 6 | + |
| 7 | +## Step 2: Deploy p2p sample page and sdk on web server |
6 | 8 | You need to edit the sample page `peercall.html`: |
7 | 9 |
|
8 | | - - Set serverAddress in line 128, change `example.com` to your p2p server address. |
9 | | - - Set correct ICE server address. |
| 10 | + - Set serverAddress on line 112: change `example.com` to your p2p server address. |
| 11 | + - Set correct ICE server addresses below that. |
| 12 | + |
| 13 | +Then choose a webserver such as Apache, and deploy the page and the sdk. |
10 | 14 |
|
11 | | -Then choose a webserver such as apache, deploy the page and sdk. |
| 15 | +## Step 3: Visit the website |
| 16 | +You can then visit the page from a web browser, with a URL such as https://server.domain.com:<PORT>/peercall.html |
12 | 17 |
|
13 | | -###3rd step: Visit the website |
14 | | -You can visit the page on web browser |
| 18 | +Open the web page from two clients with cameras connected, and choose two names. On one, type the first name and click **Login**, then type the second name and click **Set Remote Id**. On the other client, swap the names. Then click **Share Camera** on each to stream video. |
0 commit comments