Jeremy Bear wrote:

>On Mon, 7 Mar 2005 12:22:51 +0900, Eko Budi Setiyo
><contact_us / haltebis.com> wrote:
>  
>
>>Bill Guindon wrote:
>>
>>    
>>
>>>On Mon, 7 Mar 2005 12:09:09 +0900, Jeremy Bear <jeremy.bear / gmail.com> wrote:
>>>
>>>
>>>      
>>>
>>>>>>My main question, I guess, is this:  Is there any way that I can use
>>>>>>WEBrick in a local setting only that will not open up a persons
>>>>>>computer to the outside world?
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>WEBrick rocks.
>>>>>
>>>>>You can use :BindAddress => local_ip and it will be LAN accessible only. Like:
>>>>>
>>>>>:BindAddress => 192.168.0.100, :Port => 2000
>>>>>
>>>>>See its code, as I use Wee and its a bit different, like:
>>>>>Wee::WEBrickAdaptor.register('/app' => app).start(:BindAddress =>
>>>>>'192.168.0.100', :Port => 2000)
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>Ah, okay.  This seems simple enough.  My question regarding this,
>>>>though, is: What if I don't know what they have their local IP set to?
>>>>Does it need to match their IP, or is there a more "generic" one I
>>>>can use, such as the 127.0.0.1 address that vruz mentioned, that will
>>>>work no matter what for the local host?
>>>>
>>>>
>>>>        
>>>>
>>>127.0.01 is the IP for 'localhost' (ie: "this machine"), so it's a
>>>safe bet that.
>>>The only time I could see it being an issue is if they're already
>>>running another server of some kind on the same port (unlikely).
>>>
>>>
>>>
>>>      
>>>
>>Is Webrick can be use for single point of entry (every request served by
>>index.rb).
>>    
>>
>
>Eko,
>
>The concept makes sense, but I have to admit that finding
>documentation for WEBrick has been... challenging.  Could you
>elaborate on this a bit?  What do you mean by a single point of entry?
>
>Thanks,
>Jeremy
>
>
>
>  
>
Actually, I believe in the single point of entry power.
I used it in FuseLogic(php) and QLogic (ruby). index.php or index.rb 
will decide which module will be executed base on the user response 
(REQUES_URI).
One example of the benefit among the others is, lets say I change my 
hosting company and some how the install ruby on difference path. What I 
have to do is just change
the first line from #!/bin/ruby to #!/user/bin/ruby (this is example 
only!) in the index.rb

The reason I ask is I already try to use Webrick and doesn't do what I 
want.
What happen to my scripts is, lets say I already use my browser to hit 
http://127.0.0.1/index.rb/init/version than after that I hit 
http://127.0.0.1/index.rb/bittorrents/main ,
Webrick will always give the same result as 
http://127.0.0.1/index.rb/init/version

I really want to use webrick also for my RubyToday project

May be I am doing some thing wrong here. I don't know



Regards
Eko