Coder Social home page Coder Social logo

webudp's Introduction

WebUDP

WebRTC datachannel library and server

The library implements a minimal subset of WebRTC to achieve unreliable and out of order UDP transfer for browser clients. See the echo server example for how to connect to the server from a browser. The core library (Wu) is platform independent. Refer to WuHostEpoll or WuHostNode for platform-specific usage.

Building

mkdir build && cd build
cmake ..
make

Host platforms

  • Linux (epoll)
  • Node.js -DWITH_NODE=ON

Issues

  • Firefox doesn't connect to a server running on localhost. Bind a different interface.

webudp's People

Contributors

dioptre avatar seemk 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  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  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  avatar

Watchers

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

webudp's Issues

Add license & contact information

Hi,

You mind adding an open source license to this repo and some contact information so that people can reach you? Also, did you consider renaming the repo to "WebUDP" instead of "WebUdp"? #ocd

EchoServer don't send "Server Hello" in DTLSv1.0

I have test simple_echo_client.html and wusocket.js.

Test case 1:
In a ubuntu virtual machine.
Browser client(chrome) and EchoServer are all on the ubuntu. This test pass.

Test case 2:
Browser client(chrome) in Window 7 (a network behind NAT)
EachoServer on server (have a public IP)
This don't work. I have compare packet bewteen Test case 1 and Test case 2.
In test case 2, EachoServer don're reply "Server Hello" in DTLSv1.0. EachoServer
print "EchoServer: client leave" after awhile

I just update simple_echo_client.html:

 //let socket = new WuSocket(window.location.protocol + "//" + window.location.hostname + ":" + PORT);
  //let socket = new WuSocket("http://101.69.114.92" + ":" + PORT);
  //let socket = new WuSocket("http://10.8.226.202" + ":" + PORT);
  let socket = new WuSocket("http://202.5.21.177" + ":" + PORT);

And I run EachoServer in this way:
./EchoServer 202.5.21.177 9555

This is bug? or I don't use in a right way?

Thank you.

How often to poll WuUpdate

I am adapting WuNetwork.cpp to work using coroutines and I am currently calling WuUpdate via a timer. I am using 1ms intervals but haven't done enough testing to know if this is overkill, or even worse if it may cause issues when handling connection heartbeats. Do you have any input regarding a healthy/optimal interval for updating clients? Thanks

Efficient WuHostServe is buggy

If you call WuHostServe with -1 for the timeout, the most efficient mode where the thread sleeps when there is nothing to do, it's buggy. It results in pruning clients too early, because the dt delta time can end up very large, far larger than the 8s max-ttl set for a client.

It should be documented that the sleep should be below the heartbeat time (4s), as outgoing heartbeats don't flow either in the efficient mode.

Firefox README note

FF defaults to not allowing loopback RTC, but it can be enabled in about:config:
media.peerconnection.ice.loopback

Client mode

At the moment WebUDP can't initiate connections to other instances or browsers.

Using with SCTP

I was drawn here because I'm looking for a UDP like solution for an HTML5 game, however after noticing WuSctp.h and doing some further code surfing I'm interested in possibly using the webudp in projects that require reliable packets as well. Is it possible to configure WebUDP to optionally use SCTP, and if so can you point me in the direction to figure it out? I'm out of time for now to do much more digging. Thanks

WebUDP don't need a stun server and a signaling server?

I read the examples/EchoExamples.cpp, I can't find query a stun server and a signaling server.
If we want to P2P between WebUDP and chrome(js) in a network behind NAT, we should use a stun server and a signaing server.
I think WebUDP will install on the server and have a public IP, so we don't need stun server and signaling server. This is right?

Thank you.

Work on memory usage

I'm interested in seeing how tight a WebRTC connection can be in memory usage. I did a simple test of the current code, 14 tabs opened against the EchoServer and saw significant memory usage in the server. It jumps from ~500kb to over 1 MB per 14 tabs, you think this can be improved? What consumes memory? DTLS? If you can get down to a very slim memory usage, like only a few bytes per connection, that would be really interesting.

transfer data both ways.

Hi,
i have tested the echo examples and its works perfectly!:)
can i use a generic sdp offer and answer on the client side? i know the public ip of the server so no signalling is required , how can i implement this?
and how can i receive data and not just send / and support multiple connections (unique) ?

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.