Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
DRb /
Delete
Unzip
Name
Size
Permission
Date
Action
DRbArray
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbBadScheme
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbBadURI
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbConn
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbConnError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbIdConv
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbMessage
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbObject
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbObservable
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbProtocol
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbRemoteError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbSSLSocket
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbServer
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbServerNotFound
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbTCPSocket
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbUNIXSocket
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbUndumped
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbUnknown
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
DRbUnknownError
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
ExtServ
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
ExtServManager
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
GW
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
GWIdConv
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
TimerIdConv
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
cdesc-DRb.ri
13.41
KB
-rw-r--r--
2023-07-26 17:26
config-c.ri
391
B
-rw-r--r--
2023-07-26 17:26
config-i.ri
391
B
-rw-r--r--
2023-07-26 17:26
current_server-c.ri
638
B
-rw-r--r--
2023-07-26 17:26
current_server-i.ri
638
B
-rw-r--r--
2023-07-26 17:26
fetch_server-c.ri
158
B
-rw-r--r--
2023-07-26 17:26
fetch_server-i.ri
158
B
-rw-r--r--
2023-07-26 17:26
front-c.ri
359
B
-rw-r--r--
2023-07-26 17:26
front-i.ri
359
B
-rw-r--r--
2023-07-26 17:26
here%3f-c.ri
228
B
-rw-r--r--
2023-07-26 17:26
here%3f-i.ri
228
B
-rw-r--r--
2023-07-26 17:26
install_acl-c.ri
287
B
-rw-r--r--
2023-07-26 17:26
install_acl-i.ri
287
B
-rw-r--r--
2023-07-26 17:26
install_id_conv-c.ri
308
B
-rw-r--r--
2023-07-26 17:26
install_id_conv-i.ri
308
B
-rw-r--r--
2023-07-26 17:26
mutex-c.ri
141
B
-rw-r--r--
2023-07-26 17:26
mutex-i.ri
141
B
-rw-r--r--
2023-07-26 17:26
primary_server-c.ri
315
B
-rw-r--r--
2023-07-26 17:26
primary_server-i.ri
315
B
-rw-r--r--
2023-07-26 17:26
regist_server-c.ri
163
B
-rw-r--r--
2023-07-26 17:26
regist_server-i.ri
163
B
-rw-r--r--
2023-07-26 17:26
remove_server-c.ri
163
B
-rw-r--r--
2023-07-26 17:26
remove_server-i.ri
163
B
-rw-r--r--
2023-07-26 17:26
start_service-c.ri
792
B
-rw-r--r--
2023-07-26 17:26
start_service-i.ri
792
B
-rw-r--r--
2023-07-26 17:26
stop_service-c.ri
369
B
-rw-r--r--
2023-07-26 17:26
stop_service-i.ri
369
B
-rw-r--r--
2023-07-26 17:26
thread-c.ri
329
B
-rw-r--r--
2023-07-26 17:26
thread-i.ri
329
B
-rw-r--r--
2023-07-26 17:26
to_id-c.ri
377
B
-rw-r--r--
2023-07-26 17:26
to_id-i.ri
377
B
-rw-r--r--
2023-07-26 17:26
to_obj-c.ri
381
B
-rw-r--r--
2023-07-26 17:26
to_obj-i.ri
381
B
-rw-r--r--
2023-07-26 17:26
uri-c.ri
320
B
-rw-r--r--
2023-07-26 17:26
uri-i.ri
320
B
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalModule[iI"DRb:EF@0o:RDoc::Markup::Document:@parts[o;;[ES:RDoc::Markup::Heading: leveli: textI" Overview;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[ I"EdRuby is a distributed object system for Ruby. It is written in;TI"Hpure Ruby and uses its own protocol. No add-in services are needed;TI"Hbeyond those provided by the Ruby runtime, such as TCP sockets. It;TI"Cdoes not rely on or interoperate with other distributed object;TI")systems such as CORBA, RMI, or .NET.;T@o; ;[I"FdRuby allows methods to be called in one Ruby process upon a Ruby;TI"Eobject located in another Ruby process, even on another machine.;TI"CReferences to objects can be passed between processes. Method;TI"Darguments and return values are dumped and loaded in marshalled;TI"Iformat. All of this is done transparently to both the caller of the;TI"9remote method and the object that it is called upon.;T@o; ;[I">An object in a remote process is locally represented by a;TI"CDRb::DRbObject instance. This acts as a sort of proxy for the;TI"Dremote object. Methods called upon this DRbObject instance are;TI"Iforwarded to its remote object. This is arranged dynamically at run;TI"Btime. There are no statically declared interfaces for remote;TI""objects, such as CORBA's IDL.;T@o; ;[ I"DdRuby calls made into a process are handled by a DRb::DRbServer;TI"Ginstance within that process. This reconstitutes the method call,;TI"Iinvokes it upon the specified local object, and returns the value to;TI"Hthe remote caller. Any object can receive calls over dRuby. There;TI"Bis no need to implement a special interface, or mixin special;TI"Efunctionality. Nor, in the general case, does an object need to;TI"Dexplicitly register itself with a DRbServer in order to receive;TI"dRuby calls.;T@o; ;[I"FOne process wishing to make dRuby calls upon another process must;TI"Csomehow obtain an initial reference to an object in the remote;TI"Eprocess by some means other than as the return value of a remote;TI"Imethod call, as there is initially no remote object reference it can;TI"Finvoke a method upon. This is done by attaching to the server by;TI"7URI. Each DRbServer binds itself to a URI such as;TI"I'druby://example.com:8787'. A DRbServer can have an object attached;TI"Gto it that acts as the server's *front* *object*. A DRbObject can;TI"Cbe explicitly created from the server's URI. This DRbObject's;TI"Hremote object will be the server's front object. This front object;TI"Hcan then return references to other Ruby objects in the DRbServer's;TI" process.;T@o; ;[ I"HMethod calls made over dRuby behave largely the same as normal Ruby;TI"Fmethod calls made within a process. Method calls with blocks are;TI"Esupported, as are raising exceptions. In addition to a method's;TI"<standard errors, a dRuby call may also raise one of the;TI"IdRuby-specific errors, all of which are subclasses of DRb::DRbError.;T@o; ;[I"GAny type of object can be passed as an argument to a dRuby call or;TI"Greturned as its return value. By default, such objects are dumped;TI"Gor marshalled at the local end, then loaded or unmarshalled at the;TI"Gremote end. The remote end therefore receives a copy of the local;TI"Iobject, not a distributed reference to it; methods invoked upon this;TI"Gcopy are executed entirely in the remote process, not passed on to;TI"Fthe local original. This has semantics similar to pass-by-value.;T@o; ;[I"HHowever, if an object cannot be marshalled, a dRuby reference to it;TI"His passed or returned instead. This will turn up at the remote end;TI"Ias a DRbObject instance. All methods invoked upon this remote proxy;TI"Iare forwarded to the local object, as described in the discussion of;TI"?DRbObjects. This has semantics similar to the normal Ruby;TI"pass-by-reference.;T@o; ;[ I"EThe easiest way to signal that we want an otherwise marshallable;TI"Eobject to be passed or returned as a DRbObject reference, rather;TI":than marshalled and sent as a copy, is to include the;TI"#DRb::DRbUndumped mixin module.;T@o; ;[ I"FdRuby supports calling remote methods with blocks. As blocks (or;TI"Grather the Proc objects that represent them) are not marshallable,;TI"Dthe block executes in the local, not the remote, context. Each;TI"Gvalue yielded to the block is passed from the remote object to the;TI"Elocal block, then the value returned by each block invocation is;TI"Hpassed back to the remote execution context to be collected, before;TI"Fthe collected values are finally returned to the local context as;TI"/the return value of the method invocation.;T@S; ; i;I"Examples of usage;T@o; ;[I"DFor more dRuby samples, see the +samples+ directory in the full;TI"dRuby distribution.;T@S; ; i;I" dRuby in client/server mode;T@o; ;[I";This illustrates setting up a simple client-server drb;TI"Dsystem. Run the server and client code in different terminals,;TI"$starting the server code first.;T@S; ; i ;I"Server code;T@o:RDoc::Markup::Verbatim;[I"require 'drb/drb' ;FI" ;FI",# The URI for the server to connect to ;FI""URI="druby://localhost:8787" ;FI" ;FI"class TimeServer ;FI" ;FI" def get_current_time ;FI" return Time.now ;FI" end ;FI" ;FI" end ;FI" ;FI"6# The object that handles requests on the server ;FI"!FRONT_OBJECT=TimeServer.new ;FI" ;FI".$SAFE = 1 # disable eval() and friends ;FI" ;FI"*DRb.start_service(URI, FRONT_OBJECT) ;FI"@# Wait for the drb server thread to finish before exiting. ;FI"DRb.thread.join ;FS; ; i ;I"Client code;T@o;;[I"require 'drb/drb' ;FI" ;FI"# The URI to connect to ;FI")SERVER_URI="druby://localhost:8787" ;FI" ;FI"4# Start a local DRbServer to handle callbacks. ;FI"# ;FI"B# Not necessary for this small example, but will be required ;FI"C# as soon as we pass a non-marshallable object as an argument ;FI"# to a dRuby call. ;FI"DRb.start_service ;FI" ;FI"5timeserver = DRbObject.new_with_uri(SERVER_URI) ;FI"&puts timeserver.get_current_time ;FS; ; i;I"Remote objects under dRuby;T@o; ;[ I"@This example illustrates returning a reference to an object;TI"@from a dRuby call. The Logger instances live in the server;TI"Eprocess. References to them are returned to the client process,;TI"?where methods can be invoked upon them. These methods are;TI"$executed in the server process.;T@S; ; i ;I"Server code;T@o;;[:I"require 'drb/drb' ;FI" ;FI""URI="druby://localhost:8787" ;FI" ;FI"class Logger ;FI" ;FI"A # Make dRuby send Logger instances as dRuby references, ;FI" # not copies. ;FI"" include DRb::DRbUndumped ;FI" ;FI"" def initialize(n, fname) ;FI" @name = n ;FI" @filename = fname ;FI" end ;FI" ;FI" def log(message) ;FI". File.open(@filename, "a") do |f| ;FI"= f.puts("#{Time.now}: #{@name}: #{message}") ;FI" end ;FI" end ;FI" ;FI" end ;FI" ;FI"E# We have a central object for creating and retrieving loggers. ;FI"D# This retains a local reference to all loggers created. This ;FI"C# is so an existing logger can be looked up by name, but also ;FI"A# to prevent loggers from being garbage collected. A dRuby ;FI"D# reference to an object is not sufficient to prevent it being ;FI"# garbage collected! ;FI"class LoggerFactory ;FI" ;FI" def initialize(bdir) ;FI" @basedir = bdir ;FI" @loggers = {} ;FI" end ;FI" ;FI" def get_logger(name) ;FI"( if !@loggers.has_key? name ;FI"D # make the filename safe, then declare it to be so ;FI"9 fname = name.gsub(/[.\/]/, "_").untaint ;FI"K @loggers[name] = Logger.new(name, @basedir + "/" + fname) ;FI" end ;FI"# return @loggers[name] ;FI" end ;FI" ;FI" end ;FI" ;FI"1FRONT_OBJECT=LoggerFactory.new("/tmp/dlog") ;FI" ;FI".$SAFE = 1 # disable eval() and friends ;FI" ;FI"*DRb.start_service(URI, FRONT_OBJECT) ;FI"DRb.thread.join ;FS; ; i ;I"Client code;T@o;;[I"require 'drb/drb' ;FI" ;FI")SERVER_URI="druby://localhost:8787" ;FI" ;FI"DRb.start_service ;FI" ;FI"4log_service=DRbObject.new_with_uri(SERVER_URI) ;FI" ;FI"0["loga", "logb", "logc"].each do |logname| ;FI" ;FI"0 logger=log_service.get_logger(logname) ;FI" ;FI"% logger.log("Hello, world!") ;FI"' logger.log("Goodbye, world!") ;FI"# logger.log("=== EOT ===") ;FI" ;FI" end ;FS; ; i;I" Security;T@o; ;[ I"GAs with all network services, security needs to be considered when;TI"Husing dRuby. By allowing external access to a Ruby object, you are;TI"Cnot only allowing outside clients to call the methods you have;TI"Fdefined for that object, but by default to execute arbitrary Ruby;TI"2code on your server. Consider the following:;T@o;;[I"# !!! UNSAFE CODE !!! ;FI"Bro = DRbObject::new_with_uri("druby://your.server.com:8989") ;FI"class << ro ;FI"H undef :instance_eval # force call to be passed to remote object ;FI" end ;FI"$ro.instance_eval("`rm -rf *`") ;Fo; ;[ I"CThe dangers posed by instance_eval and friends are such that a;TI"ADRbServer should generally be run with $SAFE set to at least;TI"Dlevel 1. This will disable eval() and related calls on strings;TI"Gpassed across the wire. The sample usage code given above follows;TI"this practice.;T@o; ;[ I"AA DRbServer can be configured with an access control list to;TI"Gselectively allow or deny access from specified IP addresses. The;TI"Imain druby distribution provides the ACL class for this purpose. In;TI"Ggeneral, this mechanism should only be used alongside, rather than;TI"+as a replacement for, a good firewall.;T@S; ; i;I"dRuby internals;T@o; ;[ I"FdRuby is implemented using three main components: a remote method;TI"?call marshaller/unmarshaller; a transport protocol; and an;TI"HID-to-object mapper. The latter two can be directly, and the first;TI"Findirectly, replaced, in order to provide different behaviour and;TI"capabilities.;T@o; ;[I"IMarshalling and unmarshalling of remote method calls is performed by;TI"Fa DRb::DRbMessage instance. This uses the Marshal module to dump;TI"Ethe method call before sending it over the transport layer, then;TI"Dreconstitute it at the other end. There is normally no need to;TI"Dreplace this component, and no direct way is provided to do so.;TI"DHowever, it is possible to implement an alternative marshalling;TI"@scheme as part of an implementation of the transport layer.;T@o; ;[I"EThe transport layer is responsible for opening client and server;TI"Bnetwork connections and forwarding dRuby request across them.;TI"GNormally, it uses DRb::DRbMessage internally to manage marshalling;TI":and unmarshalling. The transport layer is managed by;TI">DRb::DRbProtocol. Multiple protocols can be installed in;TI"IDRbProtocol at the one time; selection between them is determined by;TI"Bthe scheme of a dRuby URI. The default transport protocol is;TI"8selected by the scheme 'druby:', and implemented by;TI";DRb::DRbTCPSocket. This uses plain TCP/IP sockets for;TI"Hcommunication. An alternative protocol, using UNIX domain sockets,;TI"Fis implemented by DRb::DRbUNIXSocket in the file drb/unix.rb, and;TI"Eselected by the scheme 'drbunix:'. A sample implementation over;TI"AHTTP can be found in the samples accompanying the main dRuby;TI"distribution.;T@o; ;[I"DThe ID-to-object mapping component maps dRuby object ids to the;TI"Fobjects they refer to, and vice versa. The implementation to use;TI"Gcan be specified as part of a DRb::DRbServer's configuration. The;TI"Fdefault implementation is provided by DRb::DRbIdConv. It uses an;TI"Hobject's ObjectSpace id as its dRuby id. This means that the dRuby;TI"Ireference to that object only remains meaningful for the lifetime of;TI"Dthe object's process and the lifetime of the object within that;TI"Hprocess. A modified implementation is provided by DRb::TimerIdConv;TI"Iin the file drb/timeridconv.rb. This implementation retains a local;TI"Dreference to all objects exported over dRuby for a configurable;TI"Fperiod of time (defaulting to ten minutes), to prevent them being;TI"Ggarbage-collected within this time. Another sample implementation;TI"His provided in sample/name.rb in the main dRuby distribution. This;TI"Iallows objects to specify their own id or "name". A dRuby reference;TI"Ccan be made persistent across processes by having each process;TI"2register an object using the same dRuby name.;T: @fileI"lib/drb/drb.rb;To;;[o; ;[I"for ruby-1.8.0;T;I"lib/drb/invokemethod.rb;T;0[[ I"primary_server;FI"RW;F:publicT@C[ @LI"RW;F:privateF@C[ [ [[I" class;F[[;[[I"config;F@C[I"current_server;F@C[I"fetch_server;F@C[I" front;F@C[I" here?;F@C[I"install_acl;F@C[I"install_id_conv;F@C[I" mutex;F@C[I"regist_server;F@C[I"remove_server;F@C[I"start_service;F@C[I"stop_service;F@C[I"thread;F@C[I" to_id;F@C[I"to_obj;F@C[I"uri;F@C[:protected[ [;[ [I" instance;F[[;[ [;[ [;[[@Y@C[@[@C[@]@C[@_@C[@a@C[@c@C[@e@C[@g@C[@i@C[@k@C[@m@C[@o@C[@q@C[@s@C[@u@C[@w@C