mruby-mod-mruby-ext

  • b7_703490
    了解作者
  • 3.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 04:28
    上传日期
这被移动到 mod_mruby 核心。 mruby-mod-mruby-ext mod_mruby 的扩展 Apache 类。 您可以通过mrbgem 扩展Apache 类。 通过mrbgems安装 将 conf.gem 行添加到build_config.rb MRuby :: Build . new do | conf | # ... (snip) ... conf . gem :git => 'https://github.com/matsumoto-r/mruby-mod-mruby-ext.git' end 例子 用 Ruby 编写 mrblib class Apache class Request def reverse_proxy path self . handler = "proxy-server" self
mruby-mod-mruby-ext-master.zip
  • mruby-mod-mruby-ext-master
  • mrblib
  • mrb_apache.rb
    540B
  • .travis.yml
    336B
  • LICENSE
    1.1KB
  • .travis_build_config.rb
    108B
  • mrbgem.rake
    127B
  • README.md
    1.1KB
  • test
  • .gitkeep
    0B
内容介绍
# This is moved to mod_mruby core. # mruby-mod-mruby-ext [![Build Status](https://travis-ci.org/matsumoto-r/mruby-mod-mruby-ext.png?branch=master)](https://travis-ci.org/matsumoto-r/mruby-mod-mruby-ext) Extended Apache class for mod_mruby. You can exnted Apache class by mrbgem. ## install by mrbgems - add conf.gem line to `build_config.rb` ```ruby MRuby::Build.new do |conf| # ... (snip) ... conf.gem :git => 'https://github.com/matsumoto-r/mruby-mod-mruby-ext.git' end ``` ## example - write mrblib by Ruby ```ruby class Apache class Request def reverse_proxy path self.handler = "proxy-server" self.proxyreq = Apache::PROXYREQ_REVERSE self.filename = "proxy:" + path end end end ``` - proxy implementation by mod_mruby before link this mrbgem ```ruby r = Apache::Request.new r.handler = "proxy-server" r.proxyreq = Apache::PROXYREQ_REVERSE r.filename = "proxy:" + "http://127.0.0.1:8001/proxy.html" ``` - proxy implementation by mod_mruby after link this mrbgem ```ruby r = Apache::Request.new r.reverse_proxy "http://127.0.0.1:8001/proxy.html" ``` ## License under the MIT License: - see LICENSE file
评论
    相关推荐