Class: QuietQUIC::Client
- Inherits:
-
Object
- Object
- QuietQUIC::Client
- Defined in:
- lib/quietquic/client.rb
Overview
Dial a cloaked QUIC server.
Build a connection with Client.connect (from a client id + PSK + server
address) or Client.connect_toml (from a client config file). Both parse and
validate the config synchronously (raising ConfigError on a
bad address or PSK), then await the native connect on the shared
runtime.
The underlying crate connect has its own internal handshake timeout (about 10 seconds); a server that never responds surfaces as ConnectError, same as any other failed dial.
Class Method Summary collapse
-
.connect(client_id:, psk:, server:) ⇒ Connection
Dial a server from this client's identity, PSK, and the server address.
-
.connect_toml(path) ⇒ Connection
Dial a server using a client config TOML file.
Class Method Details
.connect(client_id:, psk:, server:) ⇒ Connection
Dial a server from this client's identity, PSK, and the server address.
24 25 26 27 |
# File 'lib/quietquic/client.rb', line 24 def self.connect(client_id:, psk:, server:) handle = Native.client_config_from_parts(client_id, psk, server) Connection.new(QuietQUIC.await(Native::Client.connect(handle))) end |
.connect_toml(path) ⇒ Connection
Dial a server using a client config TOML file.
35 36 37 38 |
# File 'lib/quietquic/client.rb', line 35 def self.connect_toml(path) handle = Native.client_config_from_toml(path) Connection.new(QuietQUIC.await(Native::Client.connect(handle))) end |