Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing through configuration to underlying protocol. #198

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more support for **options.
  • Loading branch information
ioquatix committed Mar 11, 2025
commit dd6d036e306bb00b0d85dc9090a36c5287327e9a
8 changes: 4 additions & 4 deletions lib/async/http/protocol/http1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ def self.trailer?
true
end

def self.client(peer)
def self.client(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Client.new(stream, VERSION)
return HTTP1::Client.new(stream, VERSION, **options)
end

def self.server(peer)
def self.server(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Server.new(stream, VERSION)
return HTTP1::Server.new(stream, VERSION, **options)
end

def self.names
Expand Down
8 changes: 4 additions & 4 deletions lib/async/http/protocol/http10.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ def self.trailer?
false
end

def self.client(peer)
def self.client(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Client.new(stream, VERSION)
return HTTP1::Client.new(stream, VERSION, **options)
end

def self.server(peer)
def self.server(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Server.new(stream, VERSION)
return HTTP1::Server.new(stream, VERSION, **options)
end

def self.names
Expand Down
8 changes: 4 additions & 4 deletions lib/async/http/protocol/http11.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ def self.trailer?
true
end

def self.client(peer)
def self.client(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Client.new(stream, VERSION)
return HTTP1::Client.new(stream, VERSION, **options)
end

def self.server(peer)
def self.server(peer, **options)
stream = ::IO::Stream(peer)

return HTTP1::Server.new(stream, VERSION)
return HTTP1::Server.new(stream, VERSION, **options)
end

def self.names
Expand Down
4 changes: 2 additions & 2 deletions lib/async/http/protocol/http2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def self.trailer?
::Protocol::HTTP2::Settings::NO_RFC7540_PRIORITIES => 1,
}

def self.client(peer, settings = CLIENT_SETTINGS)
def self.client(peer, settings: CLIENT_SETTINGS)
stream = ::IO::Stream(peer)
client = Client.new(stream)

Expand All @@ -49,7 +49,7 @@ def self.client(peer, settings = CLIENT_SETTINGS)
return client
end

def self.server(peer, settings = SERVER_SETTINGS)
def self.server(peer, settings: SERVER_SETTINGS)
stream = ::IO::Stream(peer)
server = Server.new(stream)

Expand Down