Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bun #231

Open
nasselk opened this issue Mar 23, 2024 · 4 comments
Open

Support for bun #231

nasselk opened this issue Mar 23, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@nasselk
Copy link

nasselk commented Mar 23, 2024

Hey, is it posssible to add support for bun.js ?

For now, when trying to run a server using node-datachannel, that's what I get :

image

@murat-dogan
Copy link
Owner

I have never used bun.js
I can check it when I have time. Meantime all PRs are welcome.

@murat-dogan murat-dogan added the enhancement New feature or request label Apr 2, 2024
@XDGFX
Copy link

XDGFX commented Apr 9, 2024

Bun 1.0.33 on macOS seems to be working fine for me, but I'm using ES6 import syntax and TypeScript

import {
    type DescriptionType,
    type Direction,
    PeerConnection,
    Track,
    Video,
    DataChannel,
} from 'node-datachannel';

@murat-dogan
Copy link
Owner

For linux also working

murat@murat-ThinkBook:~/js/node-datachannel$ bun -v
1.1.3
murat@murat-ThinkBook:~/js/node-datachannel$ bun test/connectivity.js 
2024-04-13 20:30:43.838 DEBUG [488851] [RtcWrapper::preload@27] preload() called
2024-04-13 20:30:43.838 DEBUG [488851] [rtc::impl::Init::doInit@113] Global initialization
2024-04-13 20:30:43.838 DEBUG [488851] [rtc::impl::Init::doInit@123] Spawning 8 threads
2024-04-13 20:30:43.840 DEBUG [488873] [rtc::impl::PollService::runLoop@164] Poll service started
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::PeerConnectionWrapper@77] Constructor called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::PeerConnectionWrapper@240] Creating a new peer
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::onStateChange@694] onStateChange() called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::onIceStateChange@740] onIceStateChange() called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::onGatheringStateChange@819] onGatheringStateChange() called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::onLocalDescription@614] onLocalDescription() called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::onLocalCandidate@654] onLocalCandidate() called
2024-04-13 20:30:43.849 DEBUG [488851] [PeerConnectionWrapper::PeerConnectionWrapper@77] Constructor called
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::PeerConnectionWrapper@240] Creating a new peer
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onStateChange@694] onStateChange() called
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onIceStateChange@740] onIceStateChange() called
2024-04-13 20:30:43.850 DEBUG [488865] [rtc::impl::Certificate::Generate@430] Generating certificate (OpenSSL)
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onGatheringStateChange@819] onGatheringStateChange() called
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onLocalDescription@614] onLocalDescription() called
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onLocalCandidate@654] onLocalCandidate() called
2024-04-13 20:30:43.850 DEBUG [488866] [rtc::impl::Certificate::Generate@430] Generating certificate (OpenSSL)
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::onDataChannel@859] onDataChannel() called
2024-04-13 20:30:43.850 DEBUG [488851] [PeerConnectionWrapper::createDataChannel@443] createDataChannel() called
2024-04-13 20:30:43.850 DEBUG [488851] [rtc::impl::IceTransport::IceTransport@58] Initializing ICE transport (libjuice)
...
2024-04-13 20:30:43.921 DEBUG [488871] [DataChannelWrapper::onMessage@469] onMessage cb received from rtc
Peer1 Received Msg: Hello From Peer2
2024-04-13 20:30:43.921 DEBUG [488851] [DataChannelWrapper::onMessage@472] mOnMessageCallback call(1)
2024-04-13 20:30:43.921 DEBUG [488851] [DataChannelWrapper::onMessage@488] mOnMessageCallback call(2)
Peer2 Received Msg: Hello from Peer1
2024-04-13 20:30:48.858 DEBUG [488851] [DataChannelWrapper::close@103] close() called
2024-04-13 20:30:48.858 DEBUG [488851] [DataChannelWrapper::doClose@72] doClose() called
2024-04-13 20:30:48.858 DEBUG [488851] [DataChannelWrapper::doClose@75] Closing...
...
2024-04-13 20:30:48.870 DEBUG [488851] [PeerConnectionWrapper::onStateChange@718] mOnStateChangeCallback call(1)
murat@murat-ThinkBook:~/js/node-datachannel$ 

@ThaUnknown
Copy link
Contributor

I've confirmed bun segfaults due to NAPI bindings, track this at oven-sh/bun#158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants