little client & server apps in Ruby for downloading authorized files

R

Ruby Baby

I'm about to try a little test project in Ruby, but want to make sure
I'm on the right foot.

Any advice appreciated before I start this. MOST important : I want
to make sure I'm not just re-inventing the wheel, if there's a library
out there that does this exact thing already.


SERVER:
Has some protected files, not in a webroot, that I want to let the client
download only if they pass me a verified key in the server's "OK" database.

CLIENT:
Knows which files it wants (by file id# not full path). Knows its key to
get them. Passes some kind of message to the remote server saying, "Here
is my key. Here is the file I want." Server replies by passing the file,
and a little metadata about the file.


Sound familiar?
Should I do it from scratch or is this just some well-known library I
don't know about? (I searched around, of course, but couldn't find one.)

Thanks!
 
A

Andreas Schwarz

Ruby said:
SERVER:
Has some protected files, not in a webroot, that I want to let the client
download only if they pass me a verified key in the server's "OK" database.

CLIENT:
Knows which files it wants (by file id# not full path). Knows its key to
get them. Passes some kind of message to the remote server saying, "Here
is my key. Here is the file I want." Server replies by passing the file,
and a little metadata about the file.


Sound familiar?
Should I do it from scratch or is this just some well-known library I
don't know about? (I searched around, of course, but couldn't find one.)

Why not simply use a http server? If you already have one running, write
a CGI script, otherwise use Webrick. Then the client can use Net::HTTP
to fetch a URL like http://yourhost/server.cgi?id=324234&key=sdfhjasdf.
 

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

Members online

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top