June 2024
Beginner to intermediate
268 pages
6h 26m
English
There are a few preliminary steps you’ll need to take to connect to the signaling channel. The first is to return to the index.html file and add another <script> tag right above the one that loads the main.js file. Point it to the JavaScript file /socket.io/socket.io.js that Socket.IO automatically serves:
| » | <script src="/socket.io/socket.io.js"></script> |
| | <script src="js/main.js"></script> |
| | </body> |
| | </html> |
The main.js file depends on the contents of the socket.io.js file, which is the Socket.IO client, so be sure to include the <script> tag that points at main.js second in the HTML.
Back in the main.js file itself, in the “Signaling-Channel Setup” area up top, let’s connect to ...
Read now
Unlock full access