noia-network / webrtc-direct Goto Github PK
View Code? Open in Web Editor NEWNoia webrtc-direct implementation: use WebRTC rtcdatachannel in a server/client fashion.
License: GNU Lesser General Public License v2.1
Noia webrtc-direct implementation: use WebRTC rtcdatachannel in a server/client fashion.
License: GNU Lesser General Public License v2.1
*server (noia node uses) *
server = new WebRTCDirect.Server({ control_port: ... })
server.on("connection", channel => {
conn.on("data|error|closed", event => { ... })
conn.send(data: Buffer);
})
* client (browser and webrtc-enabled apps uses) *
client = new WebRTCDirect.Client({ server_address: '{ip/domain}:{control_port} })
client.on("established", ...)
client.request(req);
client.on("connection_failed", ...)
client.on("data", ...)
client.close();
client.on("closed", ...)
client.on("error", ...)
For webrtc-direct server:
I have no ideas if this belongs here. Chrome works perfectly but Firefox give me this error.
Session statistic
ICE restarts: 0
ICE rollbacks: 0
All Raw Candidates
▼ show raw candidates
SDP
Local SDP (Answer)
v=0
o=mozilla...THIS_IS_SDPARTA-62.0 6866766487362527213 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 A7:C5:BD:7E:EB:1F:BD:80:D7:6C:FF:25:88:32:11:C9:E3:85:70:95:8A:09:06:3F:85:A3:A0:71:E8:3B:B4:48
a=group:BUNDLE data
a=ice-options:trickle
a=msid-semantic:WMS *
m=application 47176 DTLS/SCTP 5000
c=IN IP4 192.168.1.4
a=candidate:0 1 UDP 2122252543 192.168.1.4 47176 typ host
a=candidate:1 1 TCP 2105524479 192.168.1.4 9 typ host tcptype active
a=sendrecv
a=end-of-candidates
a=ice-pwd:8a9ccbe078d78c82c8079ac59a078f25
a=ice-ufrag:ada25e7f
a=mid:data
a=sctpmap:5000 webrtc-datachannel 256
a=setup:active
a=max-message-size:1073741823
Remote SDP (Offer)
v=0
o=- 8485368344310746573 2 IN IP4 127.0.0.1
s=-
t=0 0
a=sendrecv
a=group:BUNDLE data
a=msid-semantic:WMS
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=candidate:3022624816 1 udp 2122260223 127.0.0.1 60123 typ host generation 0 ufrag 7O3T network-id 3 network-cost 50
a=sendrecv
a=fingerprint:sha-256 AA:8E:C9:B2:A3:AD:4B:2B:7A:A2:6E:4F:E1:6E:D8:67:96:31:62:7A:71:49:23:30:2D:56:DC:B7:CD:DD:F2:C0
a=ice-options:trickle
a=ice-pwd:G/wR62G0x742UwrTiJkA0/84
a=ice-ufrag:7O3T
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024
a=setup:actpass
RTP Stats
Connection log
Exit UDP socket connected
UDP socket error:Internal error at /builds/worker/workspace/build/src/dom/network/UDPSocketParent.cpp:286 this=0x7fdff4114400
/builds/worker/workspace/build/src/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): failed to create passive TCP host candidate: 3
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) no streams with non-empty check lists
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) no streams with pre-answer requests
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) no checks to start
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) pairing local trickle ICE candidate host(IP4:192.168.1.4:47176/UDP)
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) pairing local trickle ICE candidate host(IP4:192.168.1.4:56777/TCP) active
ICE(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html)): peer (PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default) Trickle grace period is over; marking every component with only failed pairs as failed.
ICE-PEER(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default)/STREAM(0-1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html) aLevel=0)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed.
ICE-PEER(PC:1536702298721082 (id=4294967312 url=http://webrtc.local/echo.html):default): all checks completed success=0 fail=1
+++++++ END ++++++++
Use WebRTC rtcdatachannel in a server/client fashion.
Purpose:
Requirements:
If webRTC is not supported, I guess I should add a webSocket fallback in client/src/client.ts#21
?
Could be nice for iOS users
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.