You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6. Finally use the RTConnect VideoCall component as you would any other React component by passing in `‘ws://localhost:PORT’` as the URL prop as well as the optional mediaOptions prop
90
90
91
-
-`URL={ ‘ws://localhost:PORT’}` (Note: the PORT whatever you specified when you set up your server)
91
+
-`URL={ ‘ws://localhost:PORT’}` (Note: the PORT whatever you specified when you set up your server so based on the server above, the port is 3000)
(Note: If you are using an https server, then pass in `‘wss://localhost:PORT’` as the URL prop).
@@ -112,30 +112,27 @@ const App = () => {
112
112
export default App;
113
113
```
114
114
115
-
## Setting Up a Secure Public Endpoint/URL
115
+
## Setting Up Public Endpoint/URL Using a Secure Tunnel Service
116
116
In order to create a publicly accessible URL that will allow you to share access to your localhost server, you have a number of different options but a simple option is to use a secure tunnel service. One such free, secure tunnel service that you can use to create a secure, encrypted, publicly accessible endpoint/URL that other users can access over the Internet is ngrok.
117
117
118
118
ngrok Secure Tunnels operate by using a locally installed ngrok agent to establish a private connection to the ngrok service. Your localhost development server is mapped to an ngrok.io sub-domain, which a remote user can then access. Once the connection is established, you get a public endpoint that you or others can use to access your local port. When a user hits the public ngrok endpoint, the ngrok edge figures out where to route the request and forwards the request over an encrypted connection to the locally running ngrok agent.
119
119
120
120
Thus, you do not need to expose ports, set up forwarding, or make any other network changes. You can simply install [ngrok npm package](https://www.npmjs.com/package/ngrok) and run it.
121
121
122
-
You have 2 options - you can install ngrok globally or you can install ngrok locally and then implement the ngrok.connect() method in your `server.js` file to open a tunnel.
123
-
124
-
1. Sign up for a free ngrok account, verify your email address, and get your authorization token.
122
+
### Instructions for Using ngrok With RTConnect
123
+
1. Sign up for a free ngrok account, verify your email address, and copy your authorization token.
125
124
126
125
2. Run the following command and replace with add your own authorization token:
127
126
```
128
127
config authtoken <your authorization token>
129
128
```
130
129
131
-
### Install ngrok Globally
132
-
133
-
1. Install the ngrok npm package globally:
130
+
3. Install the ngrok npm package globally:
134
131
```
135
132
npm install ngrok -g
136
133
```
137
134
138
-
2. Start your app - make sure your server is running before you initiate the ngrok tunnel.
135
+
4. Start your app - make sure your server is running before you initiate the ngrok tunnel.
139
136
140
137
* The following is a a basic example of what your App.jsx and server.js files might look like at this point if you used `npx create-react-app`. If you're using a proxy server, then the default port when you run `npm start` is 3000 so set your server port to something else such as 8080.
141
138
@@ -164,14 +161,14 @@ export default App;
164
161
165
162
const path = require('path');
166
163
const express = require('express');
164
+
const bodyParser = require('body-parser');
167
165
const ngrok = require('ngrok');
168
-
const app = express();
169
166
const PORT = 8080;
170
167
const { SignalingChannel } = require('rtconnect'); // import the RTConnect Signaling Channel class
Louis Disen | [GitHub](https://github.com/LouisDisen) | [LinkedIn](https://www.linkedin.com/in/louis-disen/)
282
279
<br>
283
280
284
-
---
285
281
286
-
## <aname="support"/> ## A big shoutout to all of RTConnect's stargazers! Thank you!
287
-
[](https://github.com/oslabs-beta/RTConnect/stargazers)
282
+
## <aname="support"/>A big shoutout to all of RTConnect's stargazers! Thank you!
283
+
[](https://github.com/oslabs-beta/RTConnect/stargazers)
0 commit comments