Added support for automatically setting of domain

Setting domain automatically based on Rack request environment.