Skip to content

Commit 4ad25e1

Browse files
committed
Connect now part of sockets module. Fixes #1.
1 parent 15146ea commit 4ad25e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.bs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ similarities with that document.
3434
`Socket` interface {#socket-interface}
3535
======================================
3636

37-
A `Socket` can be constructed using the global {{connect}} method, or a `connect` method
38-
defined on a <a>binding object</a>.
37+
A `Socket` can be constructed using a {{connect}} method defined in a `sockets` module
38+
(early implementations may use `vendor:sockets` for the module name),
39+
or a `connect` method defined on a <a>binding object</a>.
3940

4041
<pre class="idl">
4142
[Exposed=*]
@@ -74,6 +75,7 @@ Methods available on a {{Socket}} instance are described by the following table:
7475
The below example shows typical {{ReadableStream}} usage to read data from a socket:
7576

7677
```javascript
78+
import { connect } from 'sockets';
7779
const socket = connect("google.com:80");
7880

7981
const reader = socket.readable.getReader();
@@ -104,6 +106,7 @@ This means the stream's controller is {{ReadableStreamDefaultController}}.
104106
The below example shows typical {{WritableStream}} usage to write data to a socket:
105107

106108
```javascript
109+
import { connect } from 'sockets';
107110
const socket = connect("google.com:80");
108111

109112
const writer = socket.writable.getWriter();
@@ -164,6 +167,7 @@ connection in plain-text, with messages read and written without any encryption.
164167
Here is a simple code example showing usage:
165168

166169
```js
170+
import { connect } from 'sockets';
167171
let sock = connect("google.com:443", { secureTransport: "starttls" });
168172
// ... some code here ...
169173
// We want to StartTLS at this point.

0 commit comments

Comments
 (0)