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 nodejs client for WebTransport #717

Open
maa105 opened this issue Mar 4, 2024 · 1 comment
Open

Support nodejs client for WebTransport #717

maa105 opened this issue Mar 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@maa105
Copy link

maa105 commented Mar 4, 2024

Hello, thank you for the great work you continue to do.

It seems when creating a client for WebTransport it is expected that the environment is browser check here but one might want to use a client in nodejs environments as well. The good thing is @fails-components has a client for nodejs all that needs to be done is update the line referred above were if typeof WebTransport !== 'function' we import WebTransport from @fails-components/webtransport/lib/webtransport.node.js

I tried it locally it works (now I have other issues related to handshake) but at least it creates the WebTransport correctly

@darrachequesne
Copy link
Member

Hi! You can inject the WebTransport client in Node.js like this:

import { WebTransport } from "@fails-components/webtransport";

global.WebTransport = WebTransport;

@darrachequesne darrachequesne added the question Further information is requested label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants