Skip to content

MarcoPolo/webtransport-send-lots-of-data

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webtransport-send-lots-of-data

Starts a webtransport-go server on port 12345.

The server accepts incoming WebTransport sessions, waits for a bidirectional stream to be opened on the session, writes 256MB of data into it an closes the stream.

The client connects to the server, opens a bidirectional stream, reads all the data from it an expects to receive all of the data.

It works on Chrome, fails on Firefox.

Usage

Clone this repo then:

  • Install go1.20 or later
  • Install go deps with go get

Node.js

  • Run npm start
  • You should see something like:
% npm start

> [email protected] start
> node index.js

SERVER start
SERVER ready

Paste the following code into https://codepen.io/pen/?editors=0012 or simmilar:

(async function main ()  {
  console.info('CLIENT create session')
... more code here
// lots of output
"bytes" 268362464
"bytes" 268369920
"bytes" 268406352
"bytes" 268427592

If the stream ends successfully, you'll see:

"CLIENT read stream finished"
"CLIENT received" 268435456 "bytes of 268435456"

If it doesn't, you won't.

About

A WebTransport server that sends lots of data when a bidi stream is opened

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 52.4%
  • JavaScript 47.6%