Closed manifest closed 3 years ago
Thank you for point that out, it's good thing to keep the same naming indeed. I fixed it on master and it will be available in the next release.
As for deeper browser compatibility I will soon investigate how to seamlessly use the current API with different underlying implementation based on the compilation target:
What about user agents like Firefox or Chrome? I wonder if libdatachannels were tested against their implementations.
@manifest Yes, libdatachannel is compatible with both Firefox and Chrome.
@paullouisageneau Thanks for clearing this up. Is there any example (in cpp any other language) that I can check out. I wasn't able to make any of the browser work with the current implementation yet.
Sure, you can find C++ examples here: https://github.com/paullouisageneau/libdatachannel/tree/master/examples
In particular, client
and web
examples can connect together.
Note that this corresponds roughly to the websocket.rs
test here.
I was able to create a connection between a browser and a native app. Thanks.
@manifest I'm trying to build to the WASM target, but I get this error:
In file included from apps/app_rand.c:10:
In file included from apps/apps.h:13:
In file included from ./e_os.h:16:
In file included from include/openssl/e_os2.h:243:
/usr/lib/clang/11.1.0/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found
#include_next <inttypes.h>
^~~~~~~~~~~~
1 error generated.
make[1]: *** [Makefile:680: apps/app_rand.o] Error 1
make: *** [Makefile:177: build_libs] Error 2
thread 'main' panicked at '
Error building OpenSSL:
Command: "make" "build_libs"
Exit status: exit status: 2
Do you have any advice?
Hey @billyb2,
I haven't had a need to build the library for the WebAssembly target. IMO the browser's WebAPI is a more natural choice.
@billyb2 this library is not meant to be compiled in wasm as-is. As @manifest mentioned the browser API should be used instead, here is an example for datachannel.
So for this library this would mean to use a different backend implementation based on the compilation target (while keeping the same public API): if the compilation target is wasm then use wasm-bindgen
backend, otherwise use libdatachannel
backend.
I have been working on a wasm-bindgen
backend to achieve this, however it would break the current public API as it requires some methods to be async
. So I have not released it yet and it is still work in progress.
Thank you both very much!
Does this crate aim to be compatible with browser implementations?
I've just noticed that