XMLRPC::Server.set_valid_ip

R

Rene Paulokat

hi,
i run into trouble trying to restrict connection-attempts to
XMLRPC::Server using the method set_valid_ip
without using this restriction everything runs smoothe.

ips = ["127.0.0.1", "192.168.30.42"]
@@server.set_valid_ip(ips)

i start the server:
log says:
[Tue Aug 16 02:38:20 2005] HttpServer 192.168.30.42:8080 start

i connect with client:
log says:
HttpServer 192.168.30.42:8080 client:55058 insane<127.0.0.1> connect

but client gets an:

/usr/local/lib/ruby/1.8/xmlrpc/client.rb:535:in `do_rpc': HTTP-Error: 403 Forbidden (RuntimeError)
from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:409:in `call2'
from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:399:in `call'
from client.rb:7

although
@@server.get_valid_ip
--> [["127.0.0.1", "192.168.30.42"]]


so, if anybody got some hint...
would be great.

greetings
rene
 
D

Daniel Berger

Rene said:
hi,
i run into trouble trying to restrict connection-attempts to
XMLRPC::Server using the method set_valid_ip
without using this restriction everything runs smoothe.

ips = ["127.0.0.1", "192.168.30.42"]
@@server.set_valid_ip(ips)

<snip>

I think you need to splat the "ips" variable, e.g.
@@server.set_valid_ip(*ips).

It should probably handle that automatically.

Regards,

Dan
 
R

Rene Paulokat

I think you need to splat the "ips" variable, e.g.
@@server.set_valid_ip(*ips).

thanks for your answer, but meanwhile i think my problem is quite mysterious,
if i start little testserver:

--- snip ---
require 'xmlrpc/server'
class TestServer < XMLRPC::Server
def foo
puts "bar"
end
end

t = TestServer.new(8080)
t.add_introspection
ip = ["127.0.0.1","192.168.30.42"]
t.set_valid_ip(*ip)
t.serve
--- snap ---

result is:
/usr/local/lib/ruby/1.8/xmlrpc/client.rb:535:in `do_rpc': HTTP-Error: 500 Internal Server Error (RuntimeError)
from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:409:in `call2'
from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:399:in `call'
from client.rb:7

my client just queries for 'system.listMethods' -
if i comment out set_valid_ip - i get the expected result.

hrm, dunno

rene
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

xmlrpc 0
xmlrpc frustration 6
Problem with XMLRPC 2
xmlrpc client (HttpBadResponse error) 3
XMLRPC Question 6
why this xmlrpc call do not work ? 0
XMLRPC problems 11
xmlrpc (working on mac, not on linux, why?) 0

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,246
Latest member
softprodigy

Latest Threads

Top