Brandon,

On Wed, 9 Aug 2000, Brandon wrote:
> > I can understand why you want the proxy (/servlet) separate from the node.  
> > The only problem is that a lot of people will want to run both, and having
> > two OS processes will consume a LOT of memory.  (This is Java we're
> > talking about!)
> 
> I don't think it will actually be that big a deal, but we'll have to test
> it out and see. You could make a wrapper that could launch any number of
> (Jave-based) clients in the same process, like a start bar or something.

That's a damn good idea.

> > OK.  That's a good way to have the thing shut down.  Now all I need to do
> > is figure out how to make the client spawn stuff.  This is not possible
> > without the aid of *some* platform-specific component.  The trick is to
> > make it as clean and pleasant a mechanism as possible.  I'm sure I can
> > think of something.
> 
> What's wrong with Runtime.exec()?

The problem is that you can't guarantee that one Java process can spawn
another java process in such a way that it can outlive its parent on all
platforms.  I can think of two possible solutions:

1.  Make a special wrapper script that you Runtime.exec() that does the
spawning.  On Unix, it would look like this:

  #!/bin/sh
  java Freenet.node.Node &

On windows it would probably be

  start java Freenet.node.Node


2.  Make the wrapper script (that gets run by the user) set up some clever
interface that allows the Java process to request it to spawn the node
daemon via stdin/stdout.  If you run the Java process directly yourself
(which should theoretically only happen in development) then a box would
pop up saying it can't spawn the node, and that you have to do it yourself
by hand.

I like the second option, because it keeps the Java code pure, and there's
only one wrapper to worry about.

> > I think it would be EXTREMELY cool if we could find a way to make browsers
> > respond to URLs of the form "freenet:<key>" and direct them to the
> > freenet.  If not, we'd need to make the "proxy" re-write all the URLs
> > (they would be stored on freenet in 'freenet:<key>' form) as they come
> > back so that links would work.  Yuck.
> 
> I don't think a proxy can do that. So you'd have to integrate it into the
> browser. My research seems to indicate that you can't do that with
> Netscape or IE. Someone hacked it into lynx. Mozilla support is the
> purpose of the World Free Web project (wfw.sourceforge.net), but they're
> not getting much action. Lack of Mozilla developers, probably.

Bugger.

So - the proxy/servlet will have to convert all instances of 'freenet:..'
in the returned text (when the MIME type is text/html) to
'http://localhost:<some-port>/..' or 'http://freenet/..' if we use an HTTP
proxy.  Ug-ly.


Steve


_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to