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
# This module provides a default instance of the protocol, which can be used to create clients and servers. The name is a play on "Default" + "Singleton".
10
+
moduleDefaulton
11
+
defself.extended(base)
12
+
base.instance_variable_set(:@default,base.new)
13
+
end
14
+
15
+
attr_accessor:default
16
+
17
+
# Create a client for an outbound connection, using the default instance.
18
+
defclient(peer, **options)
19
+
default.client(peer, **options)
20
+
end
21
+
22
+
# Create a server for an inbound connection, using the default instance.
23
+
defserver(peer, **options)
24
+
default.server(peer, **options)
25
+
end
26
+
27
+
# @returns [Array] The names of the supported protocol, used for Application Layer Protocol Negotiation (ALPN), using the default instance.
Copy file name to clipboardExpand all lines: lib/async/http/protocol/http1/connection.rb
+3-2
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,10 @@ module HTTP
14
14
moduleProtocol
15
15
moduleHTTP1
16
16
classConnection < ::Protocol::HTTP1::Connection
17
-
definitialize(stream,version)
18
-
super(stream)
17
+
definitialize(stream,version, **options)
18
+
super(stream, **options)
19
19
20
+
# On the client side, we need to send the HTTP version with the initial request. On the server side, there are some scenarios (bad request) where we don't know the request version. In those cases, we use this value, which is either hard coded based on the protocol being used, OR could be negotiated during the connection setup (e.g. ALPN).
0 commit comments