Closed alicera closed 4 years ago
They should be installed on the server, after that you don't have anything special to do with libdatachannel.
I only do the "wss://localhost:8000/"? Thanks, I will try it
I try to use peerjs to create a server and let client (c++) to listen the ip port , but I cant listen it. Is it something different from web(javascript)?
https://elements.heroku.com/buttons/peers/peerjs-server I have change the port to 8000
The peerjs server requires a compatible client. You have to use the same way to send description and candidates in your client and your server. For instance, you can send JSON just like in the example clients and servers.
For peerjs test (fail)
For simple websocket test (successful)
I use the code to create server and then open client (c++)
// Node.js WebSocket server script const http = require('http'); const WebSocketServer = require('websocket').server; const server = http.createServer(); server.listen(8000); const wsServer = new WebSocketServer({ httpServer: server }); wsServer.on('request', function(request) { const connection = request.accept(null, request.origin); connection.on('message', function(message) { console.log('Received Message:', message.utf8Data); connection.sendUTF('Hi this is WebSocket server!'); }); connection.on('close', function(reasonCode, description) { console.log('Client has disconnected.'); }); });
client (c++) show WebSocket connected, signaling ready
this is client for html """ <!DOCTYPE html>
"""
Oh yes, since you connect to localhost
while your certificate is not for localhost, you have to disable certificate name verification when creating the WebSocket
:
auto ws = std::make_shared<WebSocket>(WebSocket::Configuration{.disableTlsVerification = true});
Hi, Paul-Louis How does the "web" project produce sdp message?
In the JavaScript WebRTC API, the calls to PeerConnection.createOffer()
or PeerConnection.createAnswer()
request generation of an SDP description which is returned by the browser in a promise. The candidates are then gathered by the browser and passed to a dedicated onicecandidate
callback.
I'm closing this if you have no more WSS-related questions.
I have a key and a cert for server, how to use them for libdatachannel?