1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-09 23:58:23 -05:00
denoland-deno/ext/net
snek ccd375802a
refactor(quic): introduce endpoint, 0rtt, cleanup (#27444)
A QUIC endpoint is a UDP socket which multiplexes QUIC sessions, which
may be initiated in either direction. This PR exposes endpoints and
moves things around as needed.

Now that endpoints can be reused between client connections, we have a
way to share tls tickets between them and allow 0rtt. This interface
currently works by conditionally returning a promise.

Also cleaned up the rust op names, fixed some lingering problems in the
data transmission, and switched to explicit error types.
2025-01-06 15:24:59 +01:00
..
01_net.js chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
02_tls.js chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
03_quic.js refactor(quic): introduce endpoint, 0rtt, cleanup (#27444) 2025-01-06 15:24:59 +01:00
Cargo.toml chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
io.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
lib.deno_net.d.ts refactor(quic): introduce endpoint, 0rtt, cleanup (#27444) 2025-01-06 15:24:59 +01:00
lib.rs refactor(quic): introduce endpoint, 0rtt, cleanup (#27444) 2025-01-06 15:24:59 +01:00
ops.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
ops_tls.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
ops_unix.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
quic.rs refactor(quic): introduce endpoint, 0rtt, cleanup (#27444) 2025-01-06 15:24:59 +01:00
raw.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
README.md docs: Add documentation to a subset of available extensions (#24138) 2024-06-18 00:07:48 +02:00
resolve_addr.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
tcp.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00

deno_net

This crate implements networking APIs.

Usage Example

From javascript, include the extension's source:

import * as webidl from "ext:deno_webidl/00_webidl.js";
import * as net from "ext:deno_net/01_net.js";
import * as tls from "ext:deno_net/02_tls.js";

Then from rust, provide: deno_net::deno_net::init_ops_and_esm::<Permissions>(root_cert_store_provider, unsafely_ignore_certificate_errors)

Where:

  • root_cert_store_provider: Option<Arc<dyn RootCertStoreProvider>>
  • unsafely_ignore_certificate_errors: Option<Vec<String>>
  • Permissions: A struct implementing deno_net::NetPermissions

In the extensions field of your RuntimeOptions

Dependencies

  • deno_web: Provided by the deno_web crate
  • deno_fetch: Provided by the deno_fetch crate

Provided ops

Following ops are provided, which can be accessed through Deno.ops:

Net

  • op_net_accept_tcp
  • op_net_accept_unix
  • op_net_connect_tcp
  • op_net_connect_unix
  • op_net_listen_tcp
  • op_net_listen_udp
  • op_net_listen_unix
  • op_net_listen_unixpacket
  • op_net_recv_udp
  • op_net_recv_unixpacket
  • op_net_send_udp
  • op_net_send_unixpacket
  • op_net_connect_tls
  • op_net_listen_tls
  • op_net_accept_tls
  • op_net_recv_udp
  • op_net_send_udp
  • op_net_join_multi_v4_udp
  • op_net_join_multi_v6_udp
  • op_net_leave_multi_v4_udp
  • op_net_leave_multi_v6_udp
  • op_net_set_multi_loopback_udp
  • op_net_set_multi_ttl_udp
  • op_net_accept_tcp
  • op_net_connect_tcp
  • op_net_listen_tcp
  • op_net_listen_udp
  • op_net_connect_tls
  • op_net_listen_tls
  • op_net_accept_tls
  • op_net_accept_unix
  • op_net_connect_unix
  • op_net_listen_unix
  • op_net_listen_unixpacket
  • op_net_recv_unixpacket
  • op_net_send_unixpacket

TLS

  • op_tls_start
  • op_tls_handshake
  • op_tls_key_null
  • op_tls_key_static
  • op_tls_key_static_from_file
  • op_tls_cert_resolver_create
  • op_tls_cert_resolver_poll
  • op_tls_cert_resolver_resolve
  • op_tls_cert_resolver_resolve_error
  • op_tls_start
  • op_tls_handshake

Other

  • op_node_unstable_net_listen_udp
  • op_dns_resolve
  • op_dns_resolve
  • op_set_nodelay
  • op_set_keepalive
  • op_node_unstable_net_listen_unixpacket