Code Monkey home page Code Monkey logo

webrtc-direct's People

Contributors

dancia avatar hellwolf avatar martynaszilinskas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webrtc-direct's Issues

Create webrtc-direct server/client classes

Specification

*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", ...)

References

Implement the data ports multiplexing

For webrtc-direct server:

  • Internal STUN server should return always the same public_ip/public_data_port to the webrtc stack
  • A proxy service that maps external client connections to the webrtc peer connection.

[BUG (FF?)] - ICE failed, add a STUN server and see about:webrtc for more details

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 ++++++++

Create Ze WebRTC Direct Library

Use WebRTC rtcdatachannel in a server/client fashion.

Purpose:

  • Allow server to expose two ports to the public:
    • webrtc_direct_control_port
    • webrtc_direct_data_port
  • Allow websites to download data from p2p nodes without relying on the PKI infrustructure.

Requirements:

  • Separated into Server and Client classes
  • On server side: Create an internal stun server that can be configured to return a fixed public server ip and optionally a fixed public webrtc-direct data port for multiplexing purpose
  • On server side: When multiplexing is enabled, a proxy server is implemented to map client connections and webrtc connections

[FT] fallback to ws

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

Measure performance of the server

  • Measure how long it takes to open a new channel
  • Measure how many channels can be served simultaneously
  • Measure how much bandwidth can be served simultaneously
  • Measure with both multiplexing on and off

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.