I just wanted to know that where does the HTTP framework rests in rails and how to implement a different protocol for client-server communication using different network layer?
There's a new protocol called QUIC which has low latency and if somebody wants to implement that in rails app how does someone do it? I hardly found any resources related to the implementation on internet.
At a guess, this would be handled by the Rack middleware that sits between the web server and your Rails code. Your Rails application does not interact with the web server, rather it interacts with Rack which interacts with your web server.
Rails <---> Rack <---> Web Server <---> Web Client
Here is a tiny Rack server that says "Hello, world!".
require "rack"
require "thin"
class HelloWorld
def call(env)
[ 200, { "Content-Type" => "text/plain" }, ["Hello World"] ]
end
end
Rack::Handler::Thin.run HelloWorld.new
Rack::Handler::Thin talks to the tiny thin web server passing it a response consisting of an HTTP code, HTTP headers, and the response body.
You may be in luck. The LiteSpeed web server supports QUIC and Rack has a LiteSpeed handler. It might Just Work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With