thin

A very fast & simple Ruby web server

Github星跟踪图

Thin

A small and fast Ruby web server

Installation

gem install thin

Or add thin to your Gemfile:

gem 'thin'

Usage

A +thin+ script offers an easy way to start your Rack application:

thin start

Browse the example directory for sample applications.

Usage with Rails Action Cable

To use Thin with Action Cable, add the following to your Gemfile:

gem 'faye-websocket'
gem 'thin' # If not already done

Create a config/initializers/thin_action_cable.rb:

Rails.application.config.action_cable.use_faye = true
Faye::WebSocket.load_adapter 'thin'

CLI

Use a rackup (config.ru) file and bind to localhost port 8080:

thin -R config.ru -a 127.0.0.1 -p 8080 start

Store the server process ID, log to a file and daemonize:

thin -p 9292 -P tmp/pids/thin.pid -l logs/thin.log -d start

Thin is quite flexible in that many options can be specified at the command line (see thin -h for more).

Configuration files

You can create a configuration file using thin config -C config/thin.yml.

You can then use it with all commands, such as: thin start -C config/thin.yml.

Here is an example config file:

--- 
user: www-data
group: www-data
pid: tmp/pids/thin.pid
timeout: 30
wait: 30
log: log/thin.log
max_conns: 1024
require: []
environment: production
max_persistent_conns: 512
servers: 1
threaded: true
no-epoll: true
daemonize: true
socket: tmp/sockets/thin.sock
chdir: /path/to/your/apps/root
tag: a-name-to-show-up-in-ps aux

License

Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.

Credits

The parser was originally from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under
the Ruby license and the GPL2.

Thin is copyright Marc-Andre Cournoyer macournoyer@gmail.com

Get help at http://groups.google.com/group/thin-ruby/
Report bugs at https://github.com/macournoyer/thin/issues
and major security issues directly to me at macournoyer@gmail.com.

主要指标

概览
名称与所有者macournoyer/thin
主编程语言Ruby
编程语言Ruby (语言数: 7)
平台
许可证
所有者活动
创建于2008-01-19 05:39:04
推送于2025-02-16 10:13:52
最后一次提交2025-02-16 11:13:52
发布数39
最新版本名称v1.8.2 (发布于 )
第一版名称v0.5.2 (发布于 2008-01-12 12:30:30)
用户参与
星数2.3k
关注者数52
派生数355
提交数1k
已启用问题?
问题数282
打开的问题数11
拉请求数94
打开的拉请求数6
关闭的拉请求数36
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?