-
Notifications
You must be signed in to change notification settings - Fork 3
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
Research on WebRTC #392
Comments
Any update. @devchenyan |
WebRTC (Web Real-Time Communication) is a technology that enables Web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary. The main advantages of WebRTC are:
The set of standards that comprise WebRTC makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user install plug-ins or any other third-party software.
The process of establishing a connection through ICE in WebRTC: Integrating WebRTC involves addressing two key issues:
In the same network environment, the signaling service can be integrated into Neuron, using Bluetooth as one of the communication channels. https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/createDataChannel
In the same network environment, a STUN/TURN server is not required. Implement WebRTC for establishing a connection and communication:
const peerConnection = new RTCPeerConnection(configuration);
peerConnection.onicecandidate = event => {
if (event.candidate) {
// Send candidate to remote peer
}
};
peerConnection.createOffer().then(offer => {
return peerConnection.setLocalDescription(offer);
}).then(() => {
// Send the offer to the remote peer
});
peerConnection.setRemoteDescription(remoteOffer).then(() => {
return peerConnection.createAnswer();
}).then(answer => {
return peerConnection.setLocalDescription(answer);
}).then(() => {
// Send the answer to the remote peer
});
const dataChannel = peerConnection.createDataChannel("myDataChannel");
dataChannel.onmessage = event => {
console.log("Data received:", event.data);
}; Protocol: #349 |
Any update? @devchenyan |
Feasibility has been verified. The demo will be uploaded shortly. The communication protocol design will reference WalletConnect and be added to the documentation. |
Demo: Screen-2024-07-11-180459.mp4Neuron can establish communication with the DApp and reuse WalletConnect's communication protocol design for business implementation. This also reuses part of the previous WalletConnect design. |
Through the Webrtc protocol, Neuron can realize peer-to-peer real-time communication, which will greatly expand the scope of Neuron applications.
The text was updated successfully, but these errors were encountered: