From 5f36f5c83c11b179a82fba9460e69db40d874d31 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 28 Sep 2023 13:20:51 -0600 Subject: [PATCH 1/2] Add SocketInfo and alpn/sni negotiation --- index.bs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/index.bs b/index.bs index ae91c03..b83098a 100644 --- a/index.bs +++ b/index.bs @@ -113,6 +113,10 @@ The terms {{ReadableStream}} and {{WritableStream}} are defined in [[WHATWG-STRE

Attributes

+

info

+ +The {{info}} attribute is a {{SocketInfo}} which contains information about the state of the socket. +

readable

The {{readable}} attribute is a {{ReadableStream}} which receives data from the server the socket is connected to. @@ -322,6 +326,18 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw
Initially the same as the `off` option, the connection continues in plain text until the {{startTls()}} method is called
+
+ {{alpn}} member +
+
+ The Application-Layer Protocol Negotiation list to send. If the server agrees with one of the protocols specified in this list, it will return the matching protocol in the {{info}} property. May be specified if and only if {{secureTransport}} is `on` or `starttls`. +
+
+ {{sni}} member +
+
+ The Server Name Indication TLS option to send as part of the TLS handshake. If specified, requests that the server send a certificate with a matching common name. May be specified if and only if {{secureTransport}} is `on` or `starttls`. +
{{allowHalfOpen}} member
@@ -353,6 +369,12 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw
Optionally provides the hostname/port combo of the local network endpoint, for example `"localhost:12345"`.
+
+ {{alpn}} property +
+
+ If the server agrees with one of the protocols specified in the `alpn` negotiation list, returns that protocol name as a string, otherwise `null`. +

`AnySocketAddress` type

From 52680fcdf181cf4eb9892e3bc5d8285d9f6ed205 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Fri, 27 Oct 2023 09:25:07 -0600 Subject: [PATCH 2/2] Specify alpn is an array --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index b83098a..51e85fa 100644 --- a/index.bs +++ b/index.bs @@ -330,7 +330,7 @@ At any point during the creation of the {{Socket}} instance, `connect` may throw {{alpn}} member
- The Application-Layer Protocol Negotiation list to send. If the server agrees with one of the protocols specified in this list, it will return the matching protocol in the {{info}} property. May be specified if and only if {{secureTransport}} is `on` or `starttls`. + The Application-Layer Protocol Negotiation list to send, as an array of strings. If the server agrees with one of the protocols specified in this list, it will return the matching protocol in the {{info}} property. May be specified if and only if {{secureTransport}} is `on` or `starttls`.
{{sni}} member