w3c / webtransport

WebTransport is a web API for flexible data transport
https://w3c.github.io/webtransport/
Other
824 stars 51 forks source link

Node.js support for WebTransport #511

Open wilaw opened 1 year ago

wilaw commented 1 year ago

Having support for WebTransport within Node.js would accelerate development of prototypes within the W3C WebTransport community. What can be done to initiate or support this functionality?

May be predicated on HTTP/3 support within node https://github.com/nodejs/node/issues/38478.

Any other blockers?

vasilvv commented 1 year ago

There is at least one implementation I am aware of, though I am not sure how their API compares to the W3C one.

aboba commented 1 year ago

The FAILS implementation isn't production ready and hasn't been kept up to date.

martenrichter commented 1 year ago

The FAILS implementation isn't production ready and hasn't been kept up to date.

I don't know if it is production ready. But I synced the master branch every Saturday to current quiche changes and I also backport changes, so the master branch is at least as up-to-date as quiche is. However, I did not implement yet BYOB. Or do you mean recent changes in the spec? But I have not released it for a while, are the changes in quiche since the last release sufficient for a new version?

Anyway, the API follows closely the W3C draft. With some additions for the server.

Besides, there is a PR for a test from a contributor, which is a bit stuck. The main problems, why the test is not progressing, are a lot of race conditions in the tests itself, which depends on the machine (but is not triggered on my machine), and a problem in chromium.

jasnell commented 1 year ago

I'm hoping to get QUIC support landed fully in Node.js by the end of the year, which will hopefully also include WebTransport API support. However, that's still not set in stone.

wilaw commented 1 year ago

@jasnell and @martenrichter - thanks for your feedback. We notified the WG of your work and are monitoring progress with anticipation. If there are any API changes you feel you need for node.js integration, please be sure to notify us via issue.

martenrichter commented 1 year ago

@wilaw Will do. Does this apply only client side? (I use an api server side, which close/identical to client side). So far for all implemented features, most were implemented without changes. But there are some extensions partly requested by users, can collect them and create issues.

wilaw commented 7 months ago

I'm hoping to get QUIC support landed fully in Node.js by the end of the year, which will hopefully also include WebTransport API support.

@jasnell - any holiday update on the progress of this initiative?

endel commented 6 months ago

I've just released a "playground" prototype using @martenrichter's @fails-components/webtransport: https://github.com/endel/webtransport-nodejs - it works locally on Chrome by opening https://localhost:4433 -> selecting "Advanced" -> "Proceed to localhost (unsafe)"


EDIT: Live version is available at https://web-transport.dev

martenrichter commented 6 months ago

May be I should update on the status of the node.js package (many changes in the last weeks):

Due to the new structure, it might be possible, if some QUIC/http/3 is available on node.js to built a separate transport.

jasnell commented 6 months ago

QUIC in Node.js is still in progress but moving forward. No ETA on completion as my availability to work on it is quite limited but it is making progress

fawazahmed0 commented 5 months ago

libp2p seems to have a js package for webtransport

martenrichter commented 5 months ago

libp2p seems to have a js package for webtransport

Which is for the browser side and built around the usual WebTransport interface the browser exposes: see: https://github.com/libp2p/js-libp2p/blob/a3692509feceb546b1ef2f7b5fe3138cfa43e930/packages/transport-webtransport/src/index.ts#L114