HTTP client in mruby #643
In 1.7, mruby support has ben enhanced so that handlers written in mruby can issue HTTP requests. And it is damn simple. Shown below is a full-fledged reverse proxy implementation using mruby.
mruby.handler: | Proc.new do |env| # copy headers headers = {} env.each do |key, value| if /^HTTP_/.match(key) headers[$'] = value end end # issue the request http_request( "http://app.example.com#{env["REQUEST_URI"]}", method: env["REQUEST_METHOD"], headers: headers, body: env["rack.input"], ).join endH2O exports one ruby method named
http_request
. It takes a URL and a hash of optional parameters (e.g. method, headers, body) as the arguments, and returns immediately a handle to the request. All the network operations are handled asynchronously in the event loop of H2O.When the mruby code calls the
#join
method, it returns a Rack response, either immediately (if available), or when the response headers become available. The returned body (3rd element of the response array) is an object that responds to #each
; calling the method will yield the chunks of an HTTP response as they arrive.Using the asynchronous nature of the HTTP client interface, it is possible to implement sophisticated server-side logic like Edge-side includes in very few lines of code; hopefully I will cover that in a different post.
Support for CGI #618
A FastCGI-to-CGI gateway script is included in the distribution. As shown in the example below, it is easy to create per-extention mapping to the gateway script to run CGI applications as they do on the Apache HTTP server.
file.custom-handler: extension: .cgi fastcgi.spawn: command: "exec share/h2o/fastcgi-cgi"It also has the flexibility to limit the number of CGI processes running concurrently (by using
--max-workers
option), or to run CGI applications under different directories with different user privileges by specifying appropriate user names for each directory-level fastcgi.spawn
configuration.Support for Basic Authentication #624
The distribution also bundles a basic authenticator written in mruby. The configuration snippet below will be enough to understand how it should be configured.
mruby.handler: | require "#{$H2O_ROOT}/share/h2o/mruby/htpasswd.rb" Htpasswd.new("/path/to/.htpasswd", "realm-name") file.dir: /path/to/secret-filesThe script will also be a good reference for people learning how to write mruby handlers for H2O.
Support for wild-card hostnames #634
The server finally supports wild-card hostnames as well, which is essential if you have multiple wild-card certificates to be used.
ipl 2016 points table
ReplyDeletelive predictions
tips for betting
betting on payers
some team players are changing in this matches
teams are going to change
Tfw you spend more time prrepping your stage intro than the actual match...
ReplyDeleteunblocked gaming, friv 2
I definitely enjoying every little bit of it. It is a great website and nice share:
ReplyDeletecontact form | snapchat emoji
michael kors handbags
ReplyDeleteair jordan pas cher
nike roshe flyknit
michael kors outlet clearance
ray-ban sunglasses
coach outlet online
coach outlet store online
michael kors purses
cheap jordans
cartier watches
louis vuitton handbags
louis vuitton outlet
cheap cartier watches
toms shoes
mont blanc
celine handbags
ray ban sunglasses
cheap jerseys
adidas yeezy
pandora jewelry
michael kors outlet
ray ban sunglasses uk
beats headphones wireless
instyler curling iron
cheap ray ban sunglasses
gucci
louis vuitton outlet
oakley sunglasses
louis vuitton outlet
kate spade handbags
mont blanc pens
cheap oakley sunglasses
abercrombie outlet
gucci handbags
vans shoes
michael kors outlet
nike nfl jerseys
michael kors outlet
michael kors outlet
toms shoes
20168.2wengdongdong
gucci outlet online
ReplyDeletemichael kors
red bottom
uggs
moncler coats
canada goose coats
ray bans
gucci handbags outlet
cheap air max
true religion outlet
zhi20161216
In your blog I was happy to see your article, better than last time, and have made great progress, I am very pleased. I am looking forward to your article will become better and better.
ReplyDeletehotmail login | red ball
The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
ReplyDeleteanimal jam | five nights at freddy's | hotmail login
شركة نقل عفش بالرياض وجدة والدمام والخبر والجبيل اولقطيف والاحساء والرياض وجدة ومكة المدينة المنورة والخرج والطائف وخميس مشيط وبجدة افضل شركة نقل عفش بجدة نعرضها مجموعة الفا لنقل العفش بمكة والخرج والقصيم والطائف وتبوك وخميس مشيط ونجران وجيزان وبريدة والمدينة المنورة وينبع افضل شركات نقل الاثاث بالجبيل والطائف وخميس مشيط وبريدة وعنيزو وابها ونجران المدينة وينبع تبوك والقصيم الخرج حفر الباطن والظهران
ReplyDeleteشركة نقل عفش بجدة
شركة نقل عفش بالمدينة المنورة
شركة نقل اثاث بالرياض
شركة نقل عفش بالدمام
شركة نقل عفش بالطائف
شركة نقل عفش بمكة
ReplyDeleteشركة نقل عفش بينبع
شركة نقل عفش بالخرج
شركة نقل عفش ببريدة
شركة نقل عفش بخميس مشيط
شركات نقل عفش ونظافة ومكافحة حشرات
ReplyDeleteشركات نقل عفش ونظافة ومكافحة حشرات
شركات تنظيف بالطائف
شركة تنظيف بالطائف
360 security for pc full version link
ReplyDeleteKingroot for pc english version click here
One click root for pc latest version view website
Free download Bluestacks for PC site
Showbox for PC Windows 10, 8.1, 8, 7, XP & Mac OS X Computer here
This article is interesting and useful. Thank you for sharing. And let me share an article about health that God willing will be very useful. Thank you :)
ReplyDeleteKhasiat Daun Sirsak untuk Benjolan
Obat Telinga Bernanah paling Ampuh
Cara Menghilangkan Benjolan di Miss V
Cara Memesan QnC Jelly Gamat
Penyebab Ginjal Bengkak dan Pengobatannya
Cara Mengobati kista Bartholin tanpa Operasi
Obat Tradisional Benjolan di Pangkal Paha/Selangkangan
Thank you for sharing the article.
ReplyDeletehtml color picker
Medical allowance announcement software, additionally alleged cyberbanking claims software, is now one of the best important elements database backup of a acknowledged medical practice. Medical allowance announcement is no best as time arresting as it already was.
ReplyDeleteThere might be where you can't reimburse everything of the loan to the payday advances organization. In such a circumstance, the payday advances organization by and large charges the payday credits back expense and concedes the vital installment over a more drawn out timeframe, generally an additional 14 days. Payday Loans
ReplyDeleteThe post is written in very a good manner and it contains many useful information for me. Thank you very useful information admin, and pardon me permission to share articles here may help :
ReplyDeleterisa herbal
cara menghilangkan benjolan
toko obat herbal sapnudin
sehat dan cantik alami
khasiat obat herbal
cara menghilangkan bekas jerawat
Webroot.com/safe is a protection software solution that communicates with the cloud avoiding the hassle to manage the signature updates to deploy. for office setup visit office.com/setup
ReplyDeleteNice blog. I really loved reading through this article. Thanks
ReplyDeleteDigital marketing courses in Bangalore with placements
My love never looked at who you never wanted you to be more than you are
ReplyDeleteObat Penyumbatan Pembuluh Darah Otak
Obat Tangan Kesemutan
Obat Flu Singapura
Obat Luka Diabetes Bernanah
Cara Mengobati Pembekuan Darah Di Otak