Use WebRTC RTCDataChannel in server/client programming pattern, removing the need for an extra signaling server.
Features
- End-to-end encryption provided by RTCDataChannel.
- Easy to use server/client programming interfaces for using WebRTC RTCDataChannel, encapsulating the details of how WebRTC peer connections function internally.
- Data port multiplexing: all rtc data channel from different clients are multiplexed in one data port.
cd servernpm install- create configuration
/server/.envfile from/server/.envexamplefile. npm run buildnpm run demo-echo
Console should output message (or similar):
info: UDP proxy: server listening 0.0.0.0:60123
info: Listening for HTTP requests on port 3000
- cd
client npm installnpm run build- copy
dist/webrtc-direct.min.jsintoclient/demofolder. - serve
client/demo/echo.htmlvia HTTP - open
demo.htmlvia HTTP protocol and pressconnect - enter message in input near "Send" button.
- press "Send"
- inspect received
Echo: <your message>
Note: npm install and npm run build to generate dist folder to use client as a library.