Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit cee2e5d

Browse files
jasnelladdaleaxdanbevgengjiawenLPardue
committed
quic: initial quic implementation
Co-authored-by: Anna Henningsen <[email protected]> Co-authored-by: Daniel Bevenius <[email protected]> Co-authored-by: gengjiawen <[email protected]> Co-authored-by: James M Snell <[email protected]> Co-authored-by: Lucas Pardue <[email protected]> Co-authored-by: Ouyang Yadong <[email protected]> Co-authored-by: Juan Jos<C3><A9> Arboleda <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]> Co-authored-by: Denys Otrishko <[email protected]>
1 parent e6060af commit cee2e5d

File tree

125 files changed

+25684
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+25684
-106
lines changed

LICENSE

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,58 @@ The externally maintained libraries used by Node.js are:
13161316
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13171317
"""
13181318

1319+
- ngtcp2, located at deps/ngtcp2, is licensed as follows:
1320+
"""
1321+
The MIT License
1322+
1323+
Copyright (c) 2016 ngtcp2 contributors
1324+
1325+
Permission is hereby granted, free of charge, to any person obtaining
1326+
a copy of this software and associated documentation files (the
1327+
"Software"), to deal in the Software without restriction, including
1328+
without limitation the rights to use, copy, modify, merge, publish,
1329+
distribute, sublicense, and/or sell copies of the Software, and to
1330+
permit persons to whom the Software is furnished to do so, subject to
1331+
the following conditions:
1332+
1333+
The above copyright notice and this permission notice shall be
1334+
included in all copies or substantial portions of the Software.
1335+
1336+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1337+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1338+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1339+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1340+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1341+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1342+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1343+
"""
1344+
1345+
- nghttp3, located at deps/nghttp3, is licensed as follows:
1346+
"""
1347+
The MIT License
1348+
1349+
Copyright (c) 2019 nghttp3 contributors
1350+
1351+
Permission is hereby granted, free of charge, to any person obtaining
1352+
a copy of this software and associated documentation files (the
1353+
"Software"), to deal in the Software without restriction, including
1354+
without limitation the rights to use, copy, modify, merge, publish,
1355+
distribute, sublicense, and/or sell copies of the Software, and to
1356+
permit persons to whom the Software is furnished to do so, subject to
1357+
the following conditions:
1358+
1359+
The above copyright notice and this permission notice shall be
1360+
included in all copies or substantial portions of the Software.
1361+
1362+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1363+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1364+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1365+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1366+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1367+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1368+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1369+
"""
1370+
13191371
- node-inspect, located at deps/node-inspect, is licensed as follows:
13201372
"""
13211373
Copyright Node.js contributors. All rights reserved.

configure.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@
117117
choices=valid_os,
118118
help='operating system to build for ({0})'.format(', '.join(valid_os)))
119119

120+
parser.add_option('--experimental-quic',
121+
action='store_true',
122+
dest='experimental_quic',
123+
help='enable experimental quic support')
124+
120125
parser.add_option('--gdb',
121126
action='store_true',
122127
dest='gdb',
@@ -259,6 +264,48 @@
259264
dest='shared_nghttp2_libpath',
260265
help='a directory to search for the shared nghttp2 DLLs')
261266

267+
shared_optgroup.add_option('--shared-ngtcp2',
268+
action='store_true',
269+
dest='shared_ngtcp2',
270+
help='link to a shared ngtcp2 DLL instead of static linking')
271+
272+
shared_optgroup.add_option('--shared-ngtcp2-includes',
273+
action='store',
274+
dest='shared_ngtcp2_includes',
275+
help='directory containing ngtcp2 header files')
276+
277+
shared_optgroup.add_option('--shared-ngtcp2-libname',
278+
action='store',
279+
dest='shared_ngtcp2_libname',
280+
default='ngtcp2',
281+
help='alternative lib name to link to [default: %default]')
282+
283+
shared_optgroup.add_option('--shared-ngtcp2-libpath',
284+
action='store',
285+
dest='shared_ngtcp2_libpath',
286+
help='a directory to search for the shared ngtcp2 DLLs')
287+
288+
shared_optgroup.add_option('--shared-nghttp3',
289+
action='store_true',
290+
dest='shared_nghttp3',
291+
help='link to a shared nghttp3 DLL instead of static linking')
292+
293+
shared_optgroup.add_option('--shared-nghttp3-includes',
294+
action='store',
295+
dest='shared_nghttp3_includes',
296+
help='directory containing nghttp3 header files')
297+
298+
shared_optgroup.add_option('--shared-nghttp3-libname',
299+
action='store',
300+
dest='shared_nghttp3_libname',
301+
default='nghttp3',
302+
help='alternative lib name to link to [default: %default]')
303+
304+
shared_optgroup.add_option('--shared-nghttp3-libpath',
305+
action='store',
306+
dest='shared_nghttp3_libpath',
307+
help='a directory to search for the shared nghttp3 DLLs')
308+
262309
shared_optgroup.add_option('--shared-openssl',
263310
action='store_true',
264311
dest='shared_openssl',
@@ -1145,6 +1192,14 @@ def configure_node(o):
11451192
else:
11461193
o['variables']['debug_nghttp2'] = 'false'
11471194

1195+
if options.experimental_quic:
1196+
if options.shared_openssl:
1197+
raise Exception('QUIC requires modified version of OpenSSL and cannot be'
1198+
' enabled with --shared-openssl.')
1199+
o['variables']['experimental_quic'] = 1
1200+
else:
1201+
o['variables']['experimental_quic'] = 'false'
1202+
11481203
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
11491204

11501205
o['variables']['node_shared'] = b(options.shared)
@@ -1272,6 +1327,8 @@ def without_ssl_error(option):
12721327
without_ssl_error('--openssl-no-asm')
12731328
if options.openssl_fips:
12741329
without_ssl_error('--openssl-fips')
1330+
if options.experimental_quic:
1331+
without_ssl_error('--experimental-quic')
12751332
return
12761333

12771334
if options.use_openssl_ca_store:

deps/openssl/openssl.gyp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
'OPENSSL_NO_HW',
1717
],
1818
'conditions': [
19+
[
20+
# Disable building QUIC support in openssl if experimental_quic
21+
# is not enabled.
22+
'experimental_quic!=1', {
23+
'defines': ['OPENSSL_NO_QUIC=1'],
24+
}
25+
],
1926
[ 'openssl_no_asm==1', {
2027
'includes': ['./openssl_no_asm.gypi'],
2128
}, 'target_arch=="arm64" and OS=="win"', {

doc/api/errors.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,132 @@ Accessing `Object.prototype.__proto__` has been forbidden using
16821682
[`Object.setPrototypeOf`][] should be used to get and set the prototype of an
16831683
object.
16841684

1685+
<a id="ERR_QUIC_CANNOT_SET_GROUPS"></a>
1686+
### `ERR_QUIC_CANNOT_SET_GROUPS`
1687+
1688+
> Stability: 1 - Experimental
1689+
1690+
TBD
1691+
1692+
<a id="ERR_QUIC_ERROR"></a>
1693+
### `ERR_QUIC_ERROR`
1694+
1695+
> Stability: 1 - Experimental
1696+
1697+
TBD
1698+
1699+
<a id="ERR_QUIC_TLS13_REQUIRED"></a>
1700+
### `ERR_QUIC_TLS13_REQUIRED`
1701+
1702+
> Stability: 1 - Experimental
1703+
1704+
TBD
1705+
1706+
<a id="ERR_QUIC_UNAVAILABLE"></a>
1707+
### `ERR_QUIC_UNAVAILABLE`
1708+
1709+
> Stabililty: 1 - Experimental
1710+
1711+
TBD
1712+
1713+
<a id="ERR_QUICCLIENTSESSION_FAILED"></a>
1714+
### `ERR_QUICCLIENTSESSION_FAILED`
1715+
1716+
> Stability: 1 - Experimental
1717+
1718+
TBD
1719+
1720+
<a id="ERR_QUICCLIENTSESSION_FAILED_SETSOCKET"></a>
1721+
### `ERR_QUICCLIENTSESSION_FAILED_SETSOCKET`
1722+
1723+
> Stability: 1 - Experimental
1724+
1725+
TBD
1726+
1727+
<a id="ERR_QUICSESSION_DESTROYED"></a>
1728+
### `ERR_QUICSESSION_DESTROYED`
1729+
1730+
> Stability: 1 - Experimental
1731+
1732+
TBD
1733+
1734+
<a id="ERR_QUICSESSION_INVALID_DCID"></a>
1735+
### `ERR_QUICSESSION_INVALID_DCID`
1736+
1737+
> Stability: 1 - Experimental
1738+
1739+
TBD
1740+
1741+
<a id="ERR_QUICSESSION_UPDATEKEY"></a>
1742+
### `ERR_QUICSESSION_UPDATEKEY`
1743+
1744+
> Stability: 1 - Experimental
1745+
1746+
TBD
1747+
1748+
<a id="ERR_QUICSESSION_VERSION_NEGOTIATION"></a>
1749+
### `ERR_QUICSESSION_VERSION_NEGOTIATION`
1750+
1751+
> Stability: 1 - Experimental
1752+
1753+
TBD
1754+
1755+
<a id="ERR_QUICSOCKET_DESTROYED"></a>
1756+
### `ERR_QUICSOCKET_DESTROYED`
1757+
1758+
> Stability: 1 - Experimental
1759+
1760+
TBD
1761+
1762+
<a id="ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH"></a>
1763+
### `ERR_QUICSOCKET_INVALID_STATELESS_RESET_SECRET_LENGTH`
1764+
1765+
> Stability: 1 - Experimental
1766+
1767+
TBD
1768+
1769+
<a id="ERR_QUICSOCKET_LISTENING"></a>
1770+
### `ERR_QUICSOCKET_LISTENING`
1771+
1772+
> Stability: 1 - Experimental
1773+
1774+
TBD
1775+
1776+
<a id="ERR_QUICSOCKET_UNBOUND"></a>
1777+
### `ERR_QUICSOCKET_UNBOUND`
1778+
1779+
> Stability: 1 - Experimental
1780+
1781+
TBD
1782+
1783+
<a id="ERR_QUICSTREAM_DESTROYED"></a>
1784+
### `ERR_QUICSTREAM_DESTROYED`
1785+
1786+
> Stability: 1 - Experimental
1787+
1788+
TBD
1789+
1790+
<a id="ERR_QUICSTREAM_INVALID_PUSH"></a>
1791+
### `ERR_QUICSTREAM_INVALID_PUSH`
1792+
1793+
> Stability: 1 - Experimental
1794+
1795+
TBD
1796+
1797+
<a id="ERR_QUICSTREAM_OPEN_FAILED"></a>
1798+
### `ERR_QUICSTREAM_OPEN_FAILED`
1799+
1800+
> Stability: 1 - Experimental
1801+
1802+
TBD
1803+
1804+
<a id="ERR_QUICSTREAM_UNSUPPORTED_PUSH"></a>
1805+
### `ERR_QUICSTREAM_UNSUPPORTED_PUSH`
1806+
1807+
> Stability: 1 - Experimental
1808+
1809+
TBD
1810+
16851811
<a id="ERR_REQUIRE_ESM"></a>
16861812
### `ERR_REQUIRE_ESM`
16871813

doc/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
* [Process](process.html)
4545
* [Punycode](punycode.html)
4646
* [Query Strings](querystring.html)
47+
* [QUIC](quic.html)
4748
* [Readline](readline.html)
4849
* [REPL](repl.html)
4950
* [Report](report.html)

doc/api/net.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,14 @@ immediately initiates connection with
11151115
[`socket.connect(port[, host][, connectListener])`][`socket.connect(port, host)`],
11161116
then returns the `net.Socket` that starts the connection.
11171117

1118+
## `net.createQuicSocket([options])`
1119+
<!-- YAML
1120+
added: REPLACEME
1121+
-->
1122+
1123+
Creates and returns a new `QuicSocket`. Please refer to the [QUIC documentation][]
1124+
for details.
1125+
11181126
## `net.createServer([options][, connectionListener])`
11191127
<!-- YAML
11201128
added: v0.5.0
@@ -1224,6 +1232,7 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`.
12241232
[IPC]: #net_ipc_support
12251233
[Identifying paths for IPC connections]: #net_identifying_paths_for_ipc_connections
12261234
[Readable Stream]: stream.html#stream_class_stream_readable
1235+
[QUIC documentation]: quic.html
12271236
[`'close'`]: #net_event_close
12281237
[`'connect'`]: #net_event_connect
12291238
[`'connection'`]: #net_event_connection

0 commit comments

Comments
 (0)