Hi,

On Thu, Sep 16, 2004 at 07:51:24AM -0600, Dan Libby wrote:
> 
> Hi, I'm hoping/planning to write a mozilla extension that enables users 
> to tunnel all requests through a secure channel (either SSL or SSH).

I think the easiest way for doing it is to follow darin's suggestion in
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01903.html
and implement nsISocketProvider.

Another idea would be to just write a socks proxy, that's installed on
the local PC and encrypts all requests, forwarding them to your proxy.
That way, you would also get non-HTTP data.


If changing mozilla code for what you want to is OK, you could do some
hacking w/
http://lxr.mozilla.org/seamonkey/source/netwerk/base/src/nsSocketTransport2.cpp
to do stuff w/ the data.

>  - Capability to tunnel HTTP over SSL via mozilla's internal SSL 
> protocol handler
>  - Capability to tunnel/proxy HTTP over SSH via external ssh client
>  - extension is platform independent (written in JS, XUL, etc, not C)

Oh, it gets more interesting here :)

So there is not really an "SSL protocol handler". There is an HTTPS
protocol handler. if you want to tunnel over HTTPS, that will be easy.
SSL directly, I have no idea about. you could, I think, get a socket
transport with a socket type of "ssl" and write to that like to any
other socket transport.

> - Is the support accessible via Javascript?

And I should have realized earlier that nsISocketProvider is not
actually scriptable...
http://lxr.mozilla.org/seamonkey/source/netwerk/socket/base/nsISocketProvider.idl#42


What would still work, although maybe a bit hacky, is to implement a
SOCKS server in JS, have it start with mozilla, have your extension
configure mozilla to use that server, and have that proxy forward
everything to your server. The relevant APIs are all scriptable;
although server sockets only exist since 2003-11-14 (that should be
Mozilla 1.6, or Netscape 7.2)

-- 
_______________________________________________
Mozilla-netlib mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-netlib

Reply via email to