You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: concepts/endpoints.mdx
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,35 @@ title: "Endpoints"
4
4
5
5
An _endpoint_ is the main API interface to create connections to, and accept
6
6
connections from other iroh endpoints. The connections are peer-to-peer and
7
-
encrypted, a [Relay](/concepts/relays) server is used to make the
8
-
connections reliable. Endpoints have a `EndpointID` (the public half of an
7
+
end-to-end encrypted. Endpoints have a `EndpointID` (the public half of an
9
8
Ed25519 keypair) and the private key used to sign and decrypt messages.
10
9
11
-
Generally, an application will have a single endpoint instance. This ensures all the connections made share the same peer-to-peer connections to other iroh endpoints, while still remaining independent connections. This will result in more optimal network behaviour.
10
+
Generally, an application will have a single endpoint instance. This ensures all
11
+
the connections made share the same peer-to-peer connections to other iroh
12
+
endpoints, while still remaining independent connections. This will result in
13
+
more optimal network behaviour.
12
14
13
15
14
16
## Endpoint Identifiers
15
17
16
-
Each endpoint in iroh has a unique identifier (`EndpointID`) created as a cryptographic key. This can be used to globally identify an endpoint. Because `EndpointIDs` are cryptographic keys, they are also the mechanism by which all traffic is always encrypted for a specific endpoint only.
18
+
Each endpoint in iroh has a unique identifier (`EndpointID`) created as a
19
+
cryptographic key. This can be used to globally identify an endpoint. Because
20
+
`EndpointIDs` are cryptographic keys, they are also the mechanism by which all
21
+
traffic is always encrypted for a specific endpoint only.
17
22
18
-
See the [EndpointID](https://docs.rs/iroh/latest/iroh/type.EndpointId.html) documentation for more info.
23
+
See the [EndpointID](https://docs.rs/iroh/latest/iroh/type.EndpointId.html) documentation for more information.
19
24
20
25
## Connections
21
26
22
-
Because we're in a peer-2-peer context, either endpoint might be operating as the "server", so we use `connect` and `accept` to distinguish between the two. The `connect` method is used to create a new connection to a remote endpoint, while `accept` is used to accept incoming connections from a remote endpoint.
27
+
Because we're in a peer-2-peer context, either endpoint might be operating as
28
+
the "server", so we use `connect` and `accept` to distinguish between the two.
29
+
The `connect` method is used to create a new connection to a remote endpoint,
30
+
while `accept` is used to accept incoming connections from a remote endpoint.
23
31
24
-
Connections are full-fledged QUIC connections, giving you access to most features of QUIC / HTTP3, including bidirectional and unidirectional streams.
32
+
Connections are full-fledged QUIC connections, giving you access to most
33
+
features of QUIC / HTTP3, including bidirectional and unidirectional streams.
34
+
35
+
A [Relay](/concepts/relays) server can be used to make the connections reliable.
25
36
26
37
<Note>
27
38
Due to the light-weight properties of QUIC streams a stream can only be accepted once the initiating peer has sent some data on it.
@@ -32,6 +43,6 @@ Due to the light-weight properties of QUIC streams a stream can only be accepted
32
43
Endpoints are a low-level primitive that iroh exposes on purpose. For some
33
44
projects like [dumbpipe](https://dumbpipe.dev), endpoints are 95% of what you
34
45
need to connect any two devices on the planet. For others, like
35
-
[iroh-blobs](/proto/iroh-blobs), endpoints are the foundation that higher-level
46
+
[Blobs](/protocols/blobs), endpoints are the foundation that higher-level
36
47
protocols are built on. Most projects will not work with endpoints beyond
37
48
constructing one and feeding it to one or more [protocols](/concepts/protocols).
0 commit comments