Module: Mfp

Defined in:
lib/mfp.rb,
lib/mfp/enum.rb,
lib/mfp/error.rb,
lib/mfp/event.rb,
lib/mfp/client.rb,
lib/mfp/version.rb,
lib/mfp/compressor.rb,
lib/mfp/proto/ping.rb,
lib/mfp/tls_config.rb,
lib/mfp/proto/error.rb,
lib/mfp/proto/frame.rb,
lib/mfp/proto/hello.rb,
lib/mfp/server/conn.rb,
lib/mfp/ping_handler.rb,
lib/mfp/proto/reader.rb,
lib/mfp/proto/writer.rb,
lib/mfp/server/server.rb,
lib/mfp/proto/protocol.rb,
lib/mfp/outgoing_message.rb,
lib/mfp/resettable_timer.rb,
lib/mfp/proto/hello_response.rb

Defined Under Namespace

Modules: Proto, Server Classes: Client, ClientClosedError, Compressor, ConnectionClosedError, ConnectionEvent, ControlEvent, Enum, Error, ErrorEvent, InvalidCallSignError, InvalidCallSignLengthError, OutgoingMessage, ParserError, PayloadMustBeLessThan4GBError, PayloadTooLargeError, PingHandler, ResettableTimer, StreamEvent

Constant Summary collapse

CONNECTION_EVENT_CODE_INVALID =
0
CONNECTION_EVENT_CODE_DISCONNECTED =
1
CONNECTION_EVENT_CODE_BROKEN =
2
CONNECTION_EVENT_CODE_TIMED_OUT =
3
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.default_tls_contextObject



6
7
8
9
10
11
# File 'lib/mfp/tls_config.rb', line 6

def default_tls_context
  OpenSSL::SSL::SSLContext.new.tap do |v|
    v.min_version = v.max_version = OpenSSL::SSL::TLS1_3_VERSION
    v.ecdh_curves = "X25519:P-256:P-384"
  end
end

.dial(host, port, call_sign, task) ⇒ Object



34
35
36
37
38
# File 'lib/mfp.rb', line 34

def dial(host, port, call_sign, task, **)
  cli = Client.new(host, port, call_sign, **)
  cli.start(task)
  cli
end

.listen(host, port, call_sign, task) ⇒ Object



28
29
30
31
32
# File 'lib/mfp.rb', line 28

def listen(host, port, call_sign, task, **)
  srv = Server::Server.new(host, port, call_sign, **)
  srv.start(task)
  srv
end