Giter Club home page Giter Club logo

thin's Introduction

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 [email protected]

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 [email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.