This document defines a set of ECMAScript APIs in WebIDL to allow data to be sent and received from another browser or device implementing the QUIC protocol. This specification is being developed in conjunction with protocol specifications developed by the IETF QUIC Working Group.
The API is a product of the W3C ORTC Community Group.
This specification extends the WebRTC [[!WEBRTC]] and ORTC [[!ORTC]] specifications to enable the use of QUIC [[!QUIC-TRANSPORT]] to exchange arbitrary data with remote peers using NAT-traversal technologies such as ICE, STUN, and TURN. Since QUIC can be multiplexed on the same port as RTP, RTCP, DTLS, STUN and TURN, this specification is compatible with all the functionality defined in [[!WEBRTC]] and [[!ORTC]] including communication using audio/video media and SCTP data channels.
While this specification defines an interface to QUIC streams,
    by utilizing a QUIC stream per message, it is possible to implement
    support for message-based communications (such as RTCDataChannel)
    on top.
The QUIC API presented in this specification represents a preliminary proposal based on work-in-progress within the IETF QUIC WG. Since the QUIC transport specification is a work-in-progress, both the protocol and API are likely to change significantly going forward.
This specification defines conformance criteria that apply to a single product: the user agent that implements the interfaces that it contains.
Conformance requirements phrased as algorithms or specific steps may be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be easy to follow, and not intended to be performant.)
Implementations that use ECMAScript to implement the APIs defined in this specification MUST implement them in a manner consistent with the ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL-1]], as this specification uses that specification and terminology.
The EventHandler
      interface, representing a callback used for event handlers, and the ErrorEvent
      interface are defined in [[!HTML51]].
The concepts queue a task, fires a simple event and networking task source are defined in [[!HTML51]].
The term finished reading means that the application has read all
      available data up to the STREAM frame with the FIN bit set, which causes
      the [[\Readable]] slot to be set to false.
The terms event, event handlers and event handler event types are defined in [[!HTML51]].
When referring to exceptions, the terms throw and create are defined in [[!WEBIDL-1]].
The terms fulfilled, rejected, resolved, pending and settled used in the context of Promises are defined in [[!ECMASCRIPT-6.0]].
The RTCIceTransport and RTCCertificate interfaces
      and the RTCDtlsFingerprint dictionary are defined in [[!WEBRTC]] and [[!ORTC]].
The RTCQuicTransport includes information relating
    to QUIC transport.
An RTCQuicTransport instance can be associated to
      one or more RTCQuicBidirectionalStream,
      RTCQuicSendStream, or RTCQuicReceiveStream
      instances.
The QUIC transport protocol is described in [[!QUIC-TRANSPORT]].
      A RTCQuicTransport instance is constructed
      using an RTCIceTransport and an optional sequence of
      RTCCertificate objects.
      An RTCQuicTransport object in the "closed" or
      "failed" states can be garbage-collected when it is no longer
      referenced.
The QUIC negotiation occurs between transport endpoints determined via ICE. Multiplexing of QUIC with STUN, TURN, DTLS, RTP and RTCP is supported within [[QUIC-TRANSPORT]].
A newly constructed RTCQuicTransport MUST listen and respond to incoming QUIC packets before
      start() is called. However, to complete the negotiation it is
      necessary to verify the remote fingerprint by computing fingerprints for
      the selected remote certificate using the digest algorithms provided
      in remoteParameters.fingerprints[].algorithm. If a
      calculated fingerprint and algorithm matches a fingerprint and algorithm
      included in remoteParameters.fingerprints[],
      the remote fingerprint is verified. After the QUIC handshake exchange
      completes (but before the remote fingerprint is verified) incoming media packets
      may be received. A modest buffer MUST be
      provided to avoid loss of media prior to remote fingerprint validation (which can
      begin after start() is called).
        [ Constructor (RTCIceTransport transport, optional sequence<RTCCertificate> certificates), Exposed=Window]
interface RTCQuicTransport : RTCStatsProvider {
    readonly        attribute RTCIceTransport          transport;
    readonly        attribute RTCQuicTransportState    state;
    RTCQuicParameters     getLocalParameters ();
    RTCQuicParameters?    getRemoteParameters ();
    sequence<RTCCertificate> getCertificates ();
    sequence<ArrayBuffer> getRemoteCertificates ();
    void                  start (RTCQuicParameters remoteParameters);
    void                  stop (RTCQuicTransportStopInfo stopInfo);
    RTCQuicBidirectionalStream         createBidirectionalStream ();
    RTCQuicSendStream                  createSendStream (optional RTCQuicStreamParameters parameters);
                    attribute EventHandler             onstatechange;
                    attribute EventHandler             onerror;
                    attribute EventHandler             onreceivestream;
                    attribute EventHandler             onbidirectionalstream;
};
        RTCQuicTransport constructor is invoked,
          the user agent MUST run the
          following steps:
          "closed"
            state, throw an InvalidStateError and abort
            these steps.RTCQuicTransport whose [[\QuicTransportState]] slot
            is not "closed", throw an InvalidStateError
            and abort these steps.null otherwise.
            expires attribute of each RTCCertificate
              object is in the future. If a certificate has expired, throw an
              InvalidAccessError and abort these steps.
            RTCQuicTransport object.
            RTCQuicWritableStream
            objects, initialized to empty.
            RTCQuicReadableStream
            objects, initialized to empty.
            "new".
            null or is empty,
              generate a certificate using the default key generation algorithm
              and store it in the [[\Certificates]] internal slot.
            RTCQuicTransport| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| transport | RTCIceTransport | ✘ | ✘ | |
| certificates | sequence<RTCCertificate> | ✘ | ✔ | 
transport of type RTCIceTransport, readonlyThe associated RTCIceTransport instance.
state of type RTCQuicTransportState, readonlyThe current state of the QUIC transport. On getting, it MUST return the value of the [[\QuicTransportState]] internal slot.
onstatechange of type EventHandlerThis event handler, of event handler event type
              statechange, MUST
              be fired any time the [[\QuicTransportState]] slot changes.
onerror of type EventHandlerThis event handler, of event handler event type error,
              MUST be fired on reception of a QUIC
              error; an implementation SHOULD include QUIC error information in
              error.message (defined in [[!HTML51]] Section 7.1.3.8.2).
onreceivestream of type EventHandlerThis event handler, of event handler event type
              receivestream,
              MUST be fired on when data is received
              from a newly created remote RTCQuicSendStream for the
              first time.
              
onbidirectionalstream of type EventHandlerThis event handler, of event handler event type
              bidirectionalstream,
              MUST be fired when data is received
              from a newly created remote RTCQuicBidirectionalStream for the
              first time.
              
getLocalParametersgetLocalParameters() obtains the QUIC parameters of
              the local RTCQuicTransport upon construction.
              If multiple certificates were provided in the constructor, then
              multiple fingerprints will be returned, one for each certificate.
              getLocalParameters().role always returns the default
              role of a newly constructed RTCQuicTransport;
              for a browser this will be auto.
RTCQuicParameters
              getRemoteParametersgetRemoteParameters() obtains
              the remote QUIC parameters passed in the
              start() method. Prior to calling
              start(), null is returned.
RTCQuicParameters, nullable
              getCertificatesgetCertificates() returns the value of the RTCQuicTransport's
              [[\Certificates]]> internal slot.
sequence<RTCCertificate>
              getRemoteCertificatesgetRemoteCertificates() returns the certificate chain in use by the remote side, with each
              certificate encoded in binary Distinguished Encoding Rules (DER) [[!X690]].
              getRemoteCertificates() returns an empty list prior to
              selection of the remote certificate, which is completed once
              RTCQuicTransportState transitions to
              connected.
sequence<ArrayBuffer>
              startStart QUIC transport negotiation with the parameters of the remote QUIC
              transport, including verification of the remote fingerprint.
              Only a single QUIC transport can be multiplexed over an ICE transport.
              Therefore if a RTCQuicTransport object
              quicTransportB is constructed with an
              RTCIceTransport object iceTransport
              previously used to construct another RTCQuicTransport
              object quicTransportA, then if
              quicTransportB.start() is called prior to having called
              quicTransportA.stop(), then throw an
              InvalidStateError.
If start is called after a previous start
              call, or if state is closed, throw
              an InvalidStateError.
If all of the values of
              remoteParameters.fingerprints[j].algorithm
              are unsupported, where j goes from 0 to the number of fingerprints,
              throw a NotSupportedError.
| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| remoteParameters | RTCQuicParameters | ✘ | ✘ | 
void
              stopStops and closes the RTCQuicTransport object.
              This triggers an Immediate Close as described in [[QUIC-TRANSPORT]] section 10.3.
              
When stop is called, the user agent MUST
              run the following steps:
RTCQuicTransport
                on which stop is invoked."closed"
                then abort these steps."closed".stopInfo be the first argument.void
              | Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| stopInfo | RTCQuicTransportStopInfo | ✘ | ✘ | 
createBidirectionalStreamCreates an RTCQuicBidirectionalStream object.
When createBidectionalStream is called, the user agent
              MUST run the following
              steps:
Let transport be the RTCQuicTransport
                  on which createBidectionalStream is invoked.
If transport's state is not connected
                  throw an InvalidStateError and abort these steps.
Let stream be a newly created
                  RTCQuicBidirectionalStream object.
Add stream to transport's [[\QuicTransportWritableStreams]] internal slot.
Add stream to transport's [[\QuicTransportReadableStreams]] internal slot.
Return stream and continue the following steps in the background.
Create stream's associated underlying data transport.
RTCQuicBidirectionalStream
              createSendStreamCreates an RTCQuicSendStream object.
When createSendStream is called, the user agent
              MUST run the following
              steps:
Let transport be the RTCQuicTransport
                  on which createSendStream is invoked.
If transport's state is not connected
                  throw an InvalidStateError and abort these steps.
Let stream be a newly created
                  RTCQuicSendStream object.
Add stream to transport's [[\QuicTransportWritableStreams]] internal slot.
Return stream and continue the following steps in the background.
Create stream's associated underlying data transport.
RTCQuicSendStream
              The RTCQuicParameters dictionary includes information
      relating to QUIC configuration.
dictionary RTCQuicParameters {
             RTCQuicRole                  role = "auto";
             sequence<RTCDtlsFingerprint> fingerprints;
};
        role of type RTCQuicRole, defaulting to
            "auto"The QUIC role, with a default of auto.
fingerprints of type sequence<RTCDtlsFingerprint>Sequence of fingerprints, at least one fingerprint for each certificate (with one computed with the digest algorithm used in the certificate signature).
The RTCQuicParameters dictionary includes information
      relating to QUIC stream configuration.
dictionary RTCQuicStreamParameters {
             bool disableRetransmissions = false;
};
        disableRetransmissions of type bool, defaulting to
            falsedisableRetransmissions, with a default of false.  If
              true, the stream will be sent without retransmissions.  If false, the
              stream will be sent with retransmissions.
The receivestream event uses the
      ReceiveStreamEvent interface.
        [ Constructor (DOMString type, ReceiveStreamEventInit eventInitDict), Exposed=Window]
interface ReceiveStreamEvent : Event {
    readonly        attribute RTCQuicReceiveStream stream;
};
        ReceiveStreamEvent| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| type | DOMString | ✘ | ✘ | |
| eventInitDict | ReceiveStreamEventInit | ✘ | ✘ | 
stream of type RTCQuicReceiveStream, readonlyThe stream
              attribute represents the RTCQuicReceiveStream object
              associated with the event.
The ReceiveStreamEventInit dictionary includes
          information on the configuration of the QUIC stream.
dictionary ReceiveStreamEventInit : EventInit {
             RTCQuicReceiveStream stream;
};
        stream of type RTCQuicReceiveStreamThe RTCQuicReceiveStream object associated with the
              event.
The bidirectionalstream event uses the
      BidirectionalStreamEvent interface.
        [ Constructor (DOMString type, BidirectionalStreamEventInit eventInitDict), Exposed=Window]
interface BidirectionalStreamEvent : Event {
    readonly        attribute RTCQuicBidirectionalStream stream;
};
        BidirectionalStreamEvent| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| type | DOMString | ✘ | ✘ | |
| eventInitDict | BidirectionalStreamEventInit | ✘ | ✘ | 
stream of type RTCQuicBidirectionalStream, readonlyThe stream
              attribute represents the RTCQuicBidirectionalStream object
              associated with the event.
The BidirectionalStreamEventInit dictionary includes
          information on the configuration of the QUIC stream.
dictionary BidirectionalStreamEventInit : EventInit {
             RTCQuicBidirectionalStream stream;
};
        stream of type RTCQuicBidirectionalStreamThe RTCQuicBidirectionalStream object associated with the
              event.
RTCQuicRole indicates the role of the QUIC
      transport.
enum RTCQuicRole {
    "auto",
    "client",
    "server"
};
        | Enumeration description | |
|---|---|
| auto | The QUIC role is determined based on the resolved ICE role:
                the ICE  | 
| client | The QUIC client role. | 
| server | The QUIC server role. | 
To diagnose QUIC role issues, an application may wish to determine
      the desired and actual QUIC role of an RTCQuicTransport.
      For a browser implementing ORTC, a RTCQuicTransport
      object assumes a QUIC role of auto upon construction.
      This implies that the QUIC role is determined by the ICE role.  Since
      getLocalParameters().role always returns the role assigned
      to an RTCQuicTransport object upon construction
      (auto for a browser), the getLocalParameters
      method cannot be used to determine the desired or actual role of an
      RTCQuicTransport.
An application can determine the
      desired role of an RTCQuicTransport from the value of
      remoteParameters.role passed to
      RTCQuicTransport.start(remoteParameters).
      If remoteParameters.role is server
      then the desired role of the RTCQuicTransport
      is client. If remoteParameters.role
      is client then the desired role of the
      RTCQuicTransport is server.
The RTCQuicTransport.transport.onstatechange EventHandler
      can be used to determine whether an RTCQuicTransport
      transitions to the desired role. When
      RTCQuicTransport.transport.state transitions to
      connected, if RTCQuicTransport.transport.role
      is controlled then the role of the
      RTCQuicTransport is client.
      If RTCQuicTransport.transport.role
      is controlling then the role of the
      RTCQuicTransport is server.
RTCQuicTransportState indicates the state of the QUIC
      transport.
enum RTCQuicTransportState {
    "new",
    "connecting",
    "connected",
    "closed",
    "failed"
};
        | Enumeration description | |
|---|---|
| new | The  | 
| connecting | QUIC is in the process of negotiating a secure connection and
                verifying the remote fingerprint. Once a secure connection is negotiated
                (but prior to verification of the remote fingerprint, enabled by calling
                 | 
| connected | QUIC has completed negotiation of a secure connection and verified the remote fingerprint. Outgoing data and media can now flow through. | 
| closed | The QUIC connection has been closed intentionally via a call to
                 
 | 
| failed | The QUIC connection has been closed as the result of an error (such as
                receipt of an error alert or a failure to validate the remote
                fingerprint). When the  
 | 
The RTCQuicTransportStopInfo dictionary includes information
      relating to the error code for stopping a RTCQuicTransport.
      This information is used to set the error code and reason for an CONNECTION_CLOSE
      frame.
dictionary RTCQuicTransportStopInfo {
             unsigned short errorCode = 0;
             DOMString reason = "";
        };
        
        errorCode of type unsigned short, defaulting to
            0.The error code used in CONNECTION_CLOSE frame.
reason of type DOMString, defaulting to ""The reason for stopping the RTCQuicTransport
The QUIC Stream API includes information relating
    to a QUIC stream. 
RTCQuicBidirectionalStream, RTCQuicSendStream,
      and RTCQuicReceiveStream instances are associated to
      a RTCQuicTransport instance.
An RTCQuicBidirectionalStream can be created in the following ways:
RTCQuicTransport's createBidirectionalStream method.bidirectionalstream event on the
        RTCQuicTransport.An RTCQuicSendStream can be created in the following ways:
RTCQuicTransport's createSendStream method.An RTCQuicReceiveStream can be created in the following
      ways:
receivestream event on the
        RTCQuicTransport.
        [ Exposed=Window ]
        interface mixin RTCQuicWritableStream {
            readonly attribute boolean writable;
            readonly attribute unsigned long writeBufferedAmount;
            readonly attribute Promise<RTCQuicStreamAbortInfo> writingAborted;
            void write (RTCQuicStreamWriteParameters data);
            void abortWriting (RTCQuicStreamAbortInfo abortInfo);
            Promise<void> waitForWriteBufferedAmountBelow(unsigned long threshold);
        };
        
        The RTCQuicWritableStream will initialize with
          the following:
RTCQuicWritableStream.true.writable of type boolean
            readonlyThe writable
              attribute represents whether data can be written to the
              RTCQuicWritableStream. On getting it
              MUST return the value of the
              [[\Writable]] slot.
writeBufferedAmount of type unsigned
            long, readonlyThe writeBufferedAmount
              attribute represents the number of bytes of application data
              that have been queued using write but that, as of the last
              time the event loop started executing a task, had not yet been transmitted
              to the network. This includes any data sent during the execution of the
              current task, regardless of whether the user agent is able to
              transmit text asynchronously with script execution. This does not
              include framing overhead incurred by the protocol, or buffering done
              by the operating system or network hardware. On getting, it
              MUST return the value of the
              RTCQuicWritableStream's [[\WriteBufferedAmount]] internal slot.
            
writingAborted of type RTCQuicStreamAbortInfo
            readonlyThe writingAborted
              attribute represents a promise that resolves when the
              STOP_SENDING frame is received from the RTCQuicReadableStream.
              When the stream receives a STOP_SENDING frame from its corresponding
              RTCQuicReadableStream, the user agent
              MUST run the following:
              
RTCQuicWritableStream object.
                false.RTCQuicTransport,
                which the stream was created from.
                RTCQuicStreamAbortInfo with the errorCode
                set to the value from the STOP_SENDING frame.writeWrites data to the stream. When the remote RTCQuicTransport
              receives the STREAM frame from this stream for the first time, it will trigger the
              creation of the corresponding remote stream. When the write method is
              called, the user agent MUST
              run the following steps:
RTCQuicWritableStream
               object on which data is to be sent.false, throw a NotSupportedError and abort
               these steps.false,
               throw an InvalidStateError and abort these steps.true, run the
               following:false.RTCQuicTransport,
                 which the stream was created from.RTCQuicTransport's onerror
               EventHandler.| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| data | RTCQuicStreamWriteParameters | ✘ | ✘ | 
void
              abortWritingA hard shutdown of the RTCQuicWritableStream. It may be called
              regardless of whether the RTCQuicWritableStream
              was created by the local or remote peer. When the abortWriting()
              method is called, the user agent MUST
              run the following steps:
RTCQuicWritableStream object
                which is about to abort writing.false,
                throw an InvalidStateError and abort these steps.false.RTCQuicTransport,
                which the stream was created from.| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| abortInfo | RTCQuicStreamAbortInfo | ✘ | ✘ | 
void
              waitForWriteBufferedAmountBelowwaitForWriteBufferedAmountBelow resolves the promise when
              the data queued in the write buffer falls below the given threshold.
              If waitForWriteBufferedAmountBelow
              is called multiple times, multiple promises could be resolved when the
              write buffer falls below the threshold for each promise. The Promise will
              be rejected with a newly created InvalidStateError if the
              stream's [[\Writable]] slot transitions from true to false
              and the promise isn't settled. When the waitForWriteBufferedAmountBelow method
              is called, the user agent MUST run
              the following steps:
RTCQuicWritableStream
                object on which waitForWriteBufferedAmountBelow was invoked.false, reject p with a
                newly created InvalidStateError and abort
                these steps.undefined.| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| threshold | unsigned long | ✘ | ✘ | 
Promise<void>
              
        [ Exposed=Window ]
        interface mixin RTCQuicReadableStream {
            readonly attribute boolean readable;
            readonly attribute unsigned long readableAmount;
            readonly attribute Promise<RTCQuicStreamAbortInfo> readingAborted;
            RTCQuicStreamReadResult readInto (Uint8Array data);
            void abortReading (RTCQuicStreamAbortInfo abortInfo);
            Promise<void>   waitForReadable(unsigned long amount);
        };
        
        The RTCQuicReadableStream will initialize with
          the following:
RTCQuicReadableStream.true.readable of type boolean,
            readonlyThe readable
              attribute represents whether data can be read from the RTCQuicReadableStream.
              On getting, it MUST return the value of the
              RTCQuicReadableStream's [[\Readable]] slot.
            
readableAmount of type unsigned
            long, readonlyThe readableAmount
              attribute represents the number of bytes buffered for access by
              readInto but that, as of the last time the event loop
              started executing a task, had not yet been read. This does not include
              framing overhead incurred by the protocol, or buffers associated with
              the network hardware. On getting, it MUST
              return the value of the RTCQuicReadableStream's
              [[\ReadableAmount]] internal slot.
readingAborted of type RTCQuicStreamAbortInfo
            readonlyThe readingAborted
              attribute represents a promise that resolves when the
              RST_STREAM frame is received from the RTCQuicWritableStream.
              When the stream receives a RST_STREAM frame from its corresponding
              RTCQuicWritableStream, the user agent
              MUST run the following:
              
RTCQuicReadableStream
                objectfalse.RTCQuicTransport,
                which the stream was created from.
                RTCQuicStreamAbortInfo with errorCode
                set to the value of the errror code from the RST_STREAM frame.readIntoReads from the RTCQuicReadableStream into the buffer specified
              by the first argument and returns RTCQuicStreamReadResult.
              When the readInto method is called, the user agent
              MUST run the following steps:
RTCQuicReadableStream object
               on which readInto is invoked.false,
               throw an InvalidStateError, then abort these steps.RTCQuicStreamReadResult
               to be returned.amount set to 0 and finished set to
               true and abort these steps.amount to the size of
               data in bytes.finished to true.false.RTCQuicTransport,
                 which the stream was created from.
                 finished to false.| Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| data | Uint8Array | ✘ | ✘ | 
RTCQuicStreamReadResult
              abortReadingA hard shutdown of the RTCQuicReadableStream. It may be called
              regardless of whether the RTCQuicReadableStream object
              was created by the local or remote peer. When the abortReading()
              method is called, the user agent MUST
              run the following steps:
RTCQuicReadableStream object
                which is about to abort reading.false,
                throw an InvalidStateError and abort these steps.false.RTCQuicTransport,
                which the stream was created from.
                | Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| abortInfo | RTCQuicStreamAbortInfo | ✘ | ✘ | 
void
              waitForReadablewaitForReadable waits for data to become available, or
              for the RTCQuicReadableStream to be finished reading.  It
              resolves the promise when the data queued in the read buffer
              increases above the amount provided as an argument or when a STREAM frame
              with the FIN bit set has been received. If waitForReadable
              is called multiple times, multiple promises could be resolved.
              The Promise will be rejected with a newly created
              InvalidStateError if the stream's
              [[\Readable]] slot transitions from true to false and the promise
              isn't settled. When the waitForReadable method is
              called, the user agent MUST
              run the following steps:
RTCQuicReadableStream
                on which waitForReadable is invoked.false, reject p with a
                newly created InvalidStateError and abort
                these steps.undefined when
                any of the following conditions are met:
                  | Parameter | Type | Nullable | Optional | Description | 
|---|---|---|---|---|
| amount | unsigned long | ✘ | ✘ | 
Promise<void>
              
        [ Exposed=Window ]
        interface RTCQuicStream {
            readonly attribute unsigned long long streamId;
            readonly attribute RTCQuicTransport transport;
        };
        
        streamId of type unsigned long long, readonlyThe readonly attribute referring to the ID of the
              RTCQuicStream object.
transport of type RTCQuicTransport, readonlyThe readonly attribute referring to the related RTCQuicTransport object.
        [ Exposed=Window ]
        interface RTCQuicBidirectionalStream : RTCQuicStream {
        };
        RTCQuicBidirectionalStream includes RTCQuicWritableStream;
        RTCQuicBidirectionalStream includes RTCQuicReadableStream;
        
      
        [ Exposed=Window ]
        interface RTCQuicSendStream : RTCQuicStream {
        };
        RTCQuicSendStream includes RTCQuicWritableStream;
        
      
        [ Exposed=Window ]
        interface RTCQuicReceiveStream : RTCQuicStream {
        };
        RTCQuicReceiveStream includes RTCQuicReadableStream;
        
      The RTCQuicStreamWriteParameters dictionary includes information
      relating to the data to be written with RTCQuicWritableStream.write.
dictionary RTCQuicStreamWriteParameters {
             Uint8Array data;
             boolean finished = false;
        };
        
        data of type Uint8Array.The data to be written.
finished of type boolean.Set to true if this is the last data to be written.
              This will result in a STREAM frame with the FIN bit set.
The RTCQuicStreamReadResult dictionary includes information
      relating to the result returned from readInto.
dictionary RTCQuicStreamReadResult {
             unsigned long amount;
             boolean finished = false;
        };
        
        amount of type unsigned long.The amount of data read in bytes.
finished of type boolean.Set to true if the RTCQuicReadableStream has
              finished reading.
The RTCQuicStreamAbortInfo dictionary includes information
      relating to the error code for aborting a QUIC stream. This could be used either
      in a RST_STREAM frame or STOP_SENDING frame.
dictionary RTCQuicStreamAbortInfo {
             unsigned short errorCode = 0;
        };
        
        errorCode of type unsigned short.The error code used in the RST_STREAM or STOP_SENDING frame. The default value of 0 means "STOPPING."
This section is non-normative; it specifies no new behaviour, but instead summarizes information already present in other parts of the specification. The overall security considerations of the APIs and protocols used in WebRTC are described in [[RTCWEB-SECURITY-ARCH]].
The QUIC API enables data to be communicated between browsers and other devices, including other browsers.
This means that data can be shared between applications running in different browsers, or between an application running in the same browser and something that is not a browser. This is an extension to the Web model which has had barriers against sending data between entities with different origins.
This specification provides no user prompts or chrome indicators for communication; it assumes that once the Web page has been allowed to access data, it is free to share that data with other entities as it chooses. Peer-to-peer exchanges of data via QUIC can therefore occur without any user explicit consent or involvement.
Since the browser is an active platform executing in a trusted network environment (inside the firewall), it is important to limit the damage that the browser can do to other elements on the local network, and it is important to protect data from interception, manipulation and modification by untrusted participants.
Mitigations include:
These measures are specified in the relevant IETF documents.
The fact that communication is taking place cannot be hidden from adversaries that can observe the network, so this has to be regarded as public information.
Since the QUIC protocol utilizes a cryptographic negotiation based on TLS 1.3 [[TLS13]] in order to encrypt communications, it provides confidentiality.
Utilizing the generateCertificate API in [[!WEBRTC]], it is possible to
      generate and store certificates that can subsequently be reused in constructing
      RTCQuicTransport objects.  These persistent certificates
      can therefore be used to identify a user.
The following events fire on RTCQuicTransport objects:
| Event name | Interface | Fired when... | 
|---|---|---|
| error | ErrorEvent | The RTCQuicTransportobject has encountered an error. | 
| statechange | Event | The RTCQuicTransportStatechanged. | 
| receivestream | ReceiveStreamEvent | A new RTCQuicReceiveStreamis dispatched to the
          script in response to the remote peer creating a send only QUIC stream and
          sending data on it. Prior toreceivestreamfiring, theRTCQuicReceiveStreamis added toRTCQuicTransport's [[\QuicTransportReadableStreams]]
          internal slot. | 
| bidirectionalstream | BidirectionalStreamEvent | A new RTCQuicBidirectionalStreamis dispatched to the
          script in response to the remote peer creating a bidirectional QUIC stream and
          sending data on it. Prior tobidirectionalstreamfiring, theRTCQuicBidirectionalStreamis added to theRTCQuicTransport's [[\QuicTransportReadableStreams]]
          and [[\QuicTransportWritableStreams]] internal slots. | 
Unreliable delivery can be achieved by creating many streams with retransmissions disabled, each transporting a single small message.
let quic = getQuicTransport();
let messages = getMessages();
for (msg in messages) {
  quic.createSendStream({disableRetransmissions: true}).write({data: msg, finished: true});
}
 This section will be removed before publication.
The editors wish to thank the Working Group chairs and Team Contact, Harald Alvestrand, Stefan Håkansson, Bernard Aboba and Dominique Hazaël-Massieux, for their support. Contributions to this specification were provided by Robin Raymond.
The RTCQuicTransport and RTCQuicStream objects
    were initially described in the W3C ORTC CG,
    and have been adapted for use in this specification.