WebTransport implementation based on quic-go (https://datatracker.ietf.org/doc/draft-ietf-webtrans-http3/)

webtransport-go

PkgGoDev Code Coverage

webtransport-go is an implementation of the WebTransport protocol, based on quic-go. It currently implements draft-02 of the specification.

Running a Server

// create a new webtransport.Server, listening on (UDP) port 443
s := webtransport.Server{
    H3: http3.Server{Addr: ":443"},
}

// Create a new HTTP endpoint /webtransport.
http.HandleFunc("/webtransport", func(w http.ResponseWriter, r *http.Request) {
    conn, err := s.Upgrade(w, r)
    if err != nil {
        log.Printf("upgrading failed: %s", err)
        w.WriteHeader(500)
        return
    }
    // Handle the connection. Here goes the application logic. 
    // Once this function returns, the WebTransport connection is closed.
    // If the connection is handled async, it is possible to block until it closed
    // by using the connection's context: <-conn.Context().Done().
})

s.ListenAndServeTLS(certFile, keyFile)

Now that the server is running, Chrome can be used to establish a new WebTransport session as described in this tutorial.

Running a Client

var d webtransport.Dialer
rsp, conn, err := d.Dial(ctx, "https://example.com/webtransport", nil)
// err is only nil if rsp.StatusCode is a 2xx
// Handle the connection. Here goes the application logic.
Owner
Marten Seemann
libp2p maintainer
Marten Seemann
Comments
  • feat: Implement datagram send/receive support

    feat: Implement datagram send/receive support

    Only thing it required that I'm "eh" about is the cast to quic.Connection. Maybe we are missing some interface surface in quic-go that should be added?

  • Goroutine Leak monitoring request

    Goroutine Leak monitoring request

    I am experimenting with the codebase and I noticed goroutine leak regarding a goroutine quic-go http3/client.go monitoring the request after it was hijacked.

    //`http3/client.go
    func (c *client) RoundTrip(req *http.Request) (*http.Response, error) {
    ...
    	// Request Cancellation:
    	// This go routine keeps running even after RoundTrip() returns.
    	// It is shut down when the application is done processing the body.
    	reqDone := make(chan struct{})
    	go func() {
    		select {
    		case <-req.Context().Done():
    			str.CancelWrite(quic.StreamErrorCode(errorRequestCanceled))
    			str.CancelRead(quic.StreamErrorCode(errorRequestCanceled))
    		case <-reqDone:
    		}
    	}()
    ...
    }
    

    I got around this by making the context sent to Dial canceled-able and cleaning it up.

  • Support a transport listener interface

    Support a transport listener interface

    It would be interesting for this module to just return the listener and its connection to the application and let the application to have the fun, can we?

    type interface TransportListener
    {
      func Listen() (net.Listener, error)
    }
    
  • flaky TestStreamsImmediateReset

    flaky TestStreamsImmediateReset

    === RUN   TestStreamsImmediateReset
        webtransport_test.go:257: 
            	Error Trace:	webtransport_test.go:257
            	Error:      	Received unexpected error:
            	            	Application error 0x105: received HTTP/3 frame on bidirectional stream
            	Test:       	TestStreamsImmediateReset
    --- FAIL: TestStreamsImmediateReset (0.01s)
  • WebTransport Datagrams

    WebTransport Datagrams

    There are "datagrams" in webtransport:

    https://github.com/w3c/webtransport/blob/main/explainer.md#example-of-sending-unreliable-game-state-to-server-using-datagrams

    But I can't find implementation of this in webtransport-go. Is it a feature that haven't implemented, or I have missed something?

    Thanks!

QUIC-PING: A UDP client for sending QUIC PINGs.

QUIC-PING A UDP client for sending "QUIC PING"s. What is a QUIC PING? A QUIC Initial packet with random payload and the version 0xbabababa to force Ve

Jun 20, 2022
A QUIC implementation in pure go
A QUIC implementation in pure go

A QUIC implementation in pure Go quic-go is an implementation of the QUIC protocol in Go. It implements the IETF QUIC draft-29 and draft-32. Version c

Jun 30, 2022
quiwi 🥝 - QUIC implementation in Go.

Quiwi ?? QUIC transport protocol (https://quicwg.org/) implementation in Go. The goal is to provide low level APIs for applications or protocols using

Jun 11, 2022
Antenna RPC is an RPC protocol for distributed computing, it's based on QUIC and Colfer. its currently an WIP.

aRPC - Antenna Remote Procedure Call Antenna remote procedure call (aRPC) is an RPC protocol focused on distributed processing and HPC. aRPC is implem

Jun 16, 2021
apiDocSrvc - Provide embeded doc server

apiDocSrvc - Provide embeded doc server

Oct 30, 2021
A framework for building chat interfaces with gioui.org.

chat A framework for building chat interfaces with gioui.org. The canonical copy of this repository is hosted on Sourcehut. We also have: An issue tra

Jan 16, 2022
my fork from google.golang.org/protobuf

Go support for Protocol Buffers This project hosts the Go implementation for protocol buffers, which is a language-neutral, platform-neutral, extensib

Dec 22, 2021
May 8, 2022
An Etsy StatsD (https://github.com/etsy/statsd) implementation in Go

STATSD-GO Port of Etsy's statsd, written in Go. This was forked from https://github.com/amir/gographite to provide Ganglia submission support. USAGE U

Mar 5, 2021
The Go language implementation of gRPC. HTTP/2 based RPC

gRPC-Go The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information

Jul 1, 2022
Openldap (LDAP) binding for Golang (go) ; no more support ; you may have a look at https://github.com/go-ldap/ldap

OpenLDAP this is Openldap binding in GO language. I don't work any more with golang, so, please fork this project. Installation : Installation is easy

Mar 4, 2021
screen sharing for developers https://screego.net/
screen sharing for developers https://screego.net/

screego/server screen sharing for developers Huge thanks to sipgate for sponsoring this project! Intro In the past I've had some problems sharing my s

Jun 28, 2022
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io

中文 MOSN is a network proxy written in Golang. It can be used as a cloud-native network data plane, providing services with the following proxy functio

Jul 3, 2022
HTTP, HTTP2, HTTPS, Websocket debugging proxy
HTTP, HTTP2, HTTPS, Websocket debugging proxy

English | 简体中文 We recommend updating whistle and Node to ensure that you receive important features, bugfixes and performance improvements. Some versi

Jun 26, 2022
Super fault-tolerant gateway for HTTP clusters, written in Go. White paper for reference - https://github.com/gptankit/serviceq-paper
Super fault-tolerant gateway for HTTP clusters, written in Go. White paper for reference - https://github.com/gptankit/serviceq-paper

ServiceQ ServiceQ is a fault-tolerant gateway for HTTP clusters. It employs probabilistic routing to distribute load during partial cluster shutdown (

Apr 14, 2022
Native ZooKeeper client for Go. This project is no longer maintained. Please use https://github.com/go-zookeeper/zk instead.

Native Go Zookeeper Client Library License 3-clause BSD. See LICENSE file. This Repository is No Longer Maintained Please use https://github.com/go-zo

Jul 3, 2022
inlets-connect is a proxy that supports HTTPS and the CONNECT method

inlets-connect inlets-connect is a proxy that supports HTTPS and the CONNECT method. It can be deployed as a side-car or stand-alone to proxy to a sin

Jul 19, 2021
High performance DNS over HTTPS client & server

DNS-over-HTTPS Client and server software to query DNS over HTTPS, using Google DNS-over-HTTPS protocol and IETF DNS-over-HTTPS (RFC 8484). Guides Tut

Jun 25, 2022