Closed alicera closed 4 years ago
You need to have an example signaling server running in background (either the node.js one, the python one or the rust one). Then you may run two clients and give the id of the first one to the second one so they can connect.
thanks, So the client only can type the " id " ,other messages cant be type ,right?
Indeed it's not possible by default, however you could modify it to allow typing messages.
I have another problem " connectivity.cpp " and " signaling-server.py " do the same thing?
connectivity.cpp do the 1~5 "signaling-server.py do the 1 ~ 4 " + " client do the 5 "
connectivity.cpp do the 1~5 "signaling-server.py do the 1 ~ 4 " + " client do the 5 "
You are right, connectivity.cpp
is a connectivity test acting as two clients with a signaling server.
I try to run the web with node server.js I cant type the "remote ID" or "message" in the interface
The remote ID input is disabled because the WebSocket failed to connect to signaling server. Please check that the node server is still running and that it didn't encounter any error. You should actually run the example with npm (npm install
then npm start
).
How to let C++ connect browser without WebSocket Do you have any idea ?
You can't establish a WebRTC connection without exchanging the descriptions first. It's necessay for firewall and NAT traversal, and for security verifications.
A WebSocket is not required though. You can pass the descriptions through any channel, for instance you could use HTTP polling or server-sent events.
The "libdatachannel/examples/client/" pass the descriptions through websocket, right? "libdatachannel/examples/signaling-server-python/" and "libdatachannel/examples/web/" ,too.
Can the "pass the descriptions through any channel" consider a Signaling Server?
Yes the examples all use WebSocket, except the copy-paste ones which use the user copy-pasting.
Yes whatever method you use you'll need a server, since the browser can only open connections to a server.
I want to create a signaling server for c++ and "libdatachannel/examples/web/" , instead of websocket. Could you recommend me some method for libdatachannel?
I guess HTTP POST requests for client-to-server and server-sent events (or HTTP long poll) for server-to-client should work nearly as well as websockets, you should look into that.
Can a signaling server be create by iceServers? For example config.iceServers.emplace_back("stun:stun.l.google.com:19302"); // change to your STUN server
No that's not possible as they don't allow relaying information like that.
Yes both do. ICE is always the first part of the datachannel establishment in 5.
I use "config.iceServers.emplace_back("stun.l.google.com:19302");" in offerer.cpp and it show the message """ 2020-08-06 19:40:56.989 WARN [952] [rtc::IceTransport::LogCallback@267] juice: agent.c:1007: STUN message send failed, errno=101 """
If using the websocket as the Signaling Server. Is it possible to exchange SDP for two different IP (client A and client B)?
2020-08-06 19:40:56.989 WARN [952] [rtc::IceTransport::LogCallback@267] juice: agent.c:1007: STUN message send failed, errno=101
This is just a warning, probably because IPv6 network is not reachable but the STUN server has an IPv6 address. It should still connect fine.
If using the websocket as the Signaling Server. Is it possible to exchange SDP for two different IP (client A and client B)?
What do you mean ?
If using the websocket as the Signaling Server. Is it possible to exchange SDP for two different IP (client A and client B)? change to
If using the websocket as the Signaling Server. Is it possible to exchange SDP for two client and the clients are Public IP
Sure, that's the principle, you need the signaling server to be hosted on a public IP too and both clients should connect to it to exchange descriptions.
Thanks For Your Help
You're welcome, I'm closing this if you don't have other issues with the client.
"examples/client" cant offer to "examples/web" But "examples/web" can offer to "examples/client "
Could you describe the issue please?
ok
libdatachannel/examples/client/ I run the project and it show the message. how to do to run it?
2020-07-31 17:03:00.400 ERROR [3024] [rtc::TcpTransport::runLoop@310] TCP connect: Connection to localhost:8000 failed WebSocket failed: TCP connection failed 2020-07-31 17:03:00.401 DEBUG [3016] [rtc::TcpTransport::stop@100] Waiting for TCP recv thread