fails-components / webtransport

Http/3 webtransport support for node
Other
132 stars 20 forks source link

Firefox cannot dial @fails-components/webtransport server #265

Closed achingbrain closed 4 months ago

achingbrain commented 4 months ago

Here's a simple echo server

$ git clone https://github.com/achingbrain/webtransport-echo-server.git
$ cd webtransport-echo-server
$ npm i
$ npm run browser

> webtransport-echo-server@1.0.0 browser
> node browser.js

Paste the following code into https://codepen.io or similar:

(async function main ()  {
  console.info('CLIENT create session')
// ...more code here

Running the code in Chrome yields the expected* result:

"CLIENT create session"
"CLIENT wait for session"
"CLIENT session ready"
"CLIENT create bidi stream"
"CLIENT get writer"
"CLIENT wait for writer"
"CLIENT write"
"CLIENT close writer"
"CLIENT read from stream"
"CLIENT got from stream" // [object Object] 
{
  "done": false,
  "value": {
    "0": 0,
    "1": 1,
    "2": 2,
    "3": 3
  }
}
"CLIENT read from stream"

When running in Firefox Nightly (125.0a1 (2024-03-05) (64-bit)), the session never becomes ready:

"CLIENT create session"
"CLIENT wait for session"

* = the read stream doesn't end, but it won't until #256 ships

martenrichter commented 4 months ago

But the firefox units worked so far. (But it is an older Firefox version). Can you test it in the context of the Firefox unit test to figure out if it works there? (I made some analogue to your Chromium tests). Is it the nightly including: https://bugzilla.mozilla.org/show_bug.cgi?id=1873263 https://bugzilla.mozilla.org/show_bug.cgi?id=1872496 ?

And then the question arises, if it is on my side or the browser side. (I learned that it is often not the fault of the package.)

achingbrain commented 4 months ago

Ah, that first one was only merged about five hours ago, it's probably not in nightly yet - I'll check back at the end of the week.

martenrichter commented 4 months ago

And I would be surprised if it did not work with the node.js server as I wrote the firefox patch testing against the unit test server of this package.

achingbrain commented 4 months ago

Fingers crossed.

achingbrain commented 4 months ago

Uncross your fingers, it all works with today's nightly!