Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quic: part 3... initial quic implementation #32379

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions LICENSE
Expand Up @@ -1316,6 +1316,58 @@ The externally maintained libraries used by Node.js are:
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- ngtcp2, located at deps/ngtcp2, is licensed as follows:
"""
The MIT License

Copyright (c) 2016 ngtcp2 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- nghttp3, located at deps/nghttp3, is licensed as follows:
"""
The MIT License

Copyright (c) 2019 nghttp3 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- node-inspect, located at deps/node-inspect, is licensed as follows:
"""
Copyright Node.js contributors. All rights reserved.
Expand Down
57 changes: 57 additions & 0 deletions configure.py
Expand Up @@ -122,6 +122,11 @@
dest='error_on_warn',
help='Turn compiler warnings into errors for node core sources.')

parser.add_option('--experimental-quic',
action='store_true',
dest='experimental_quic',
help='enable experimental quic support')

parser.add_option('--gdb',
action='store_true',
dest='gdb',
Expand Down Expand Up @@ -269,6 +274,48 @@
dest='shared_nghttp2_libpath',
help='a directory to search for the shared nghttp2 DLLs')

shared_optgroup.add_option('--shared-ngtcp2',
action='store_true',
dest='shared_ngtcp2',
help='link to a shared ngtcp2 DLL instead of static linking')

shared_optgroup.add_option('--shared-ngtcp2-includes',
action='store',
dest='shared_ngtcp2_includes',
help='directory containing ngtcp2 header files')

shared_optgroup.add_option('--shared-ngtcp2-libname',
action='store',
dest='shared_ngtcp2_libname',
default='ngtcp2',
help='alternative lib name to link to [default: %default]')

shared_optgroup.add_option('--shared-ngtcp2-libpath',
action='store',
dest='shared_ngtcp2_libpath',
help='a directory to search for the shared ngtcp2 DLLs')

shared_optgroup.add_option('--shared-nghttp3',
action='store_true',
dest='shared_nghttp3',
help='link to a shared nghttp3 DLL instead of static linking')

shared_optgroup.add_option('--shared-nghttp3-includes',
action='store',
dest='shared_nghttp3_includes',
help='directory containing nghttp3 header files')

shared_optgroup.add_option('--shared-nghttp3-libname',
action='store',
dest='shared_nghttp3_libname',
default='nghttp3',
help='alternative lib name to link to [default: %default]')

shared_optgroup.add_option('--shared-nghttp3-libpath',
action='store',
dest='shared_nghttp3_libpath',
help='a directory to search for the shared nghttp3 DLLs')

shared_optgroup.add_option('--shared-openssl',
action='store_true',
dest='shared_openssl',
Expand Down Expand Up @@ -1178,6 +1225,14 @@ def configure_node(o):
else:
o['variables']['debug_nghttp2'] = 'false'

if options.experimental_quic:
if options.shared_openssl:
raise Exception('QUIC requires a modified version of OpenSSL and '
'cannot be enabled when using --shared-openssl.')
o['variables']['experimental_quic'] = 1
else:
o['variables']['experimental_quic'] = 'false'

o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)

o['variables']['node_shared'] = b(options.shared)
Expand Down Expand Up @@ -1309,6 +1364,8 @@ def without_ssl_error(option):
without_ssl_error('--openssl-fips')
if options.openssl_default_cipher_list:
without_ssl_error('--openssl-default-cipher-list')
if options.experimental_quic:
without_ssl_error('--experimental-quic')
return

if options.use_openssl_ca_store:
Expand Down
7 changes: 7 additions & 0 deletions deps/openssl/openssl.gyp
Expand Up @@ -16,6 +16,13 @@
'OPENSSL_NO_HW',
],
'conditions': [
[
# Disable building QUIC support in openssl if experimental_quic
# is not enabled.
'experimental_quic!=1', {
'defines': ['OPENSSL_NO_QUIC=1'],
}
],
[ 'openssl_no_asm==1', {
'includes': ['./openssl_no_asm.gypi'],
}, 'target_arch=="arm64" and OS=="win"', {
Expand Down
119 changes: 119 additions & 0 deletions doc/api/errors.md
Expand Up @@ -1717,6 +1717,125 @@ Accessing `Object.prototype.__proto__` has been forbidden using
[`Object.setPrototypeOf`][] should be used to get and set the prototype of an
object.

<a id="ERR_QUIC_CANNOT_SET_GROUPS"></a>
### `ERR_QUIC_CANNOT_SET_GROUPS`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUIC_ERROR"></a>
### `ERR_QUIC_ERROR`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUIC_TLS13_REQUIRED"></a>
### `ERR_QUIC_TLS13_REQUIRED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICCLIENTSESSION_FAILED"></a>
### `ERR_QUICCLIENTSESSION_FAILED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICCLIENTSESSION_FAILED_SETSOCKET"></a>
### `ERR_QUICCLIENTSESSION_FAILED_SETSOCKET`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSESSION_DESTROYED"></a>
### `ERR_QUICSESSION_DESTROYED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSESSION_INVALID_DCID"></a>
### `ERR_QUICSESSION_INVALID_DCID`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSESSION_UPDATEKEY"></a>
### `ERR_QUICSESSION_UPDATEKEY`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSESSION_VERSION_NEGOTIATION"></a>
### `ERR_QUICSESSION_VERSION_NEGOTIATION`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSOCKET_DESTROYED"></a>
### `ERR_QUICSOCKET_DESTROYED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH"></a>
### `ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSOCKET_LISTENING"></a>
### `ERR_QUICSOCKET_LISTENING`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSOCKET_UNBOUND"></a>
### `ERR_QUICSOCKET_UNBOUND`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSTREAM_DESTROYED"></a>
### `ERR_QUICSTREAM_DESTROYED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSTREAM_INVALID_PUSH"></a>
### `ERR_QUICSTREAM_INVALID_PUSH`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSTREAM_OPEN_FAILED"></a>
### `ERR_QUICSTREAM_OPEN_FAILED`

> Stability: 1 - Experimental

TBD

<a id="ERR_QUICSTREAM_UNSUPPORTED_PUSH"></a>
### `ERR_QUICSTREAM_UNSUPPORTED_PUSH`

> Stability: 1 - Experimental

TBD

<a id="ERR_REQUIRE_ESM"></a>
### `ERR_REQUIRE_ESM`

Expand Down
1 change: 1 addition & 0 deletions doc/api/index.md
Expand Up @@ -44,6 +44,7 @@
* [Process](process.html)
* [Punycode](punycode.html)
* [Query Strings](querystring.html)
* [QUIC](quic.html)
* [Readline](readline.html)
* [REPL](repl.html)
* [Report](report.html)
Expand Down
9 changes: 9 additions & 0 deletions doc/api/net.md
Expand Up @@ -1105,6 +1105,14 @@ immediately initiates connection with
[`socket.connect(port[, host][, connectListener])`][`socket.connect(port)`],
then returns the `net.Socket` that starts the connection.

## `net.createQuicSocket([options])`
<!-- YAML
added: REPLACEME
-->

Creates and returns a new `QuicSocket`. Please refer to the [QUIC documentation][]
for details.

## `net.createServer([options][, connectionListener])`
<!-- YAML
added: v0.5.0
Expand Down Expand Up @@ -1213,6 +1221,7 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`.
[IPC]: #net_ipc_support
[Identifying paths for IPC connections]: #net_identifying_paths_for_ipc_connections
[Readable Stream]: stream.html#stream_class_stream_readable
[QUIC documentation]: quic.html
[`'close'`]: #net_event_close
[`'connect'`]: #net_event_connect
[`'connection'`]: #net_event_connection
Expand Down