jruby-rack-standalone-jetty

tomdz/jruby-rack-standalone-jetty · GitHub

jruby-rack-standalone-jetty

Provides a way to run jruby-rack with an embedded jetty,
no WAR files or separate servlet container needed. You simply write a launcher script that contains
code like this:

require 'jetty-runner'

jetty_options = {
  :host => 'localhost',
  :port => 4567,
  # jruby-rack context parameters:
  'jruby.rack.layout_class' => 'RailsFilesystemLayout',
  'gem.path' => '.',
  'rackup' => IO.read('config.ru')
}

server = JettyRunner.new(jetty_options)
server.run
server.join

The options hash supports all jruby-rack context parameters.

Supported Jetty options:

  • :host The IP to bind to. localhost by default.
  • :port The port to use. If not specified then Jetty will use a random one.
  • :use_nio Whether to use NIO instead of blocking IO for HTTP (does not affect HTTPS). true by default
  • :min_threads The minimum number of threads. 10 by default.
  • :max_threads The maximum number of threads. 200 by default.
  • :low_threads The number of threads that are considered to be low. 50 by default.
  • :accept_queue_size The number of requests to be allowed in the accept queue. Uses the value of :max_threads by
    default.
  • :ssl_port The HTTPS port. If not specified (along with :keystore and :key_password) then HTTPS will not be
    enabled.
  • :keystore The keystore. If not specified (along with :ssl_port and :key_password) then HTTPS will not be
    enabled.
  • :key_password The password for the key in the keystore. If not specified (along with :ssl_port and :keystore)
    then HTTPS will not be enabled.
  • :keystore_type The type of the keystore. JKS by default.
  • :with_stats Whether to enable Jetty statistics and expose them via JMX. true by default.
  • :request_log The request log object to use (must implement org.mortbay.jetty.RequestLog). If neither this nor
    :request_log_path are specified, then request logging will not be enabled.
  • :request_log_path The path where the NCSARequestLog should log to. If neither this nor :request_log are
    specified, then request logging will not be enabled.
  • :resource_base Base folder for resolving resources (such as config.ru). Default is ..
posted on 2012-03-15 01:22  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/03/15/2397213.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值