12 - securing drb services with access control lists.rb

来自「O Reilly Ruby Cookbook source code」· RB 代码 · 共 18 行

RB
18
字号
#!/usr/bin/ruby# acl_hash_server.rbrequire 'drb'require 'drb/acl'# Setup the security--remember to call before DRb.start_service()DRb.install_acl(ACL.new(%w{ deny all                            allow 192.168.1.*                            allow 127.0.0.1 } ) )# Start up DRb with a URI and a hash to shareshared_hash = {:server => 'Some data set by the server' }DRb.start_service("druby://127.0.0.1:61676", shared_hash)puts 'Listening for connection...'DRb.thread.join  # Wait on DRb thread to exit...#---

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?