Skip to content

Commit

Permalink
quic: initial quic implementation
Browse files Browse the repository at this point in the history
Co-authored-by: Anna Henningsen <anna@addaleax.net>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: gengjiawen <technicalcute@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com>
Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com>
Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Denys Otrishko <shishugi@gmail.com>
  • Loading branch information
9 people committed Mar 12, 2020
1 parent 295191f commit 2350cdf
Show file tree
Hide file tree
Showing 123 changed files with 25,625 additions and 91 deletions.
52 changes: 52 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
choices=valid_os,
help='operating system to build for ({0})'.format(', '.join(valid_os)))

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 @@ -259,6 +264,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 @@ -1146,6 +1193,14 @@ def configure_node(o):
else:
o['variables']['debug_nghttp2'] = 'false'

if options.experimental_quic:
if options.shared_openssl:
raise Exception('QUIC requires modified version of OpenSSL and cannot be'
' enabled with --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 @@ -1273,6 +1328,8 @@ def without_ssl_error(option):
without_ssl_error('--openssl-no-asm')
if options.openssl_fips:
without_ssl_error('--openssl-fips')
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,125 @@ The `package.json` [exports][] field does not export the requested subpath.
Because exports are encapsulated, private internal modules that are not exported
cannot be imported through the package resolution, unless using an absolute URL.

<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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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
Loading

0 comments on commit 2350cdf

Please sign in to comment.