2

如何从 http 请求转换并传递到命中 routes.rb 文件的请求。我知道webrick,但我找不到webrick的代码在哪里

4

1 回答 1

1

This is the path your request is going through when using Webrick:

host -> port -> sockets -> connections -> packets

This is the hierarchy of containers. Host is localhost and the port is either 80 (invisible) or 3000 (explicit).

Webrick "listens" at a port until a client creates a socket and makes a connection. The connection then persists, and another client can connect at the same port.

A connection is like a virtual pair of wires. The server and client communicate by sending and receiving messages, and the connection protocol cuts these up into packets. Because Webrick only deals with one packet at a time, and because the connection layer stores the actual server and client information, Webrick can handle multiple browsers at the same time.

You can read more here

于 2013-07-03T14:04:32.030 回答