jinterface problems

Luke Gorrie luke@REDACTED
Tue Mar 11 20:40:28 CET 2003


Rasmus Jonsson <rasmus_jonsson@REDACTED> writes:

> What we actually are trying to accomplish is to let any client
> (anywhere) download an java applet over http from a inets server on
> the erlang node, and then we want the java applet and the e-node to
> start communica- ting. (here we cannot require any empd running on
> the client!)

I think that jinterface is the right way, but I would suggest using
your own protocol instead of distributed Erlang. You can do this by
opening a regular TCP socket and the Otp{Input,Output}Stream in Java
and term_to_binary/binary_to_term in Erlang to translate between
Erlang terms and binary data (for sending over sockets.)

Two good things about this approach: the networking part is simple and
predictable (you open the socket however you like), and you have
control over what messages are sent and how they are
processed. Security-wise, giving someone access to your Erlang node
via distribution is equivalent to giving them a shell on your machine,
so if you used distributed Erlang you should be very careful about who
you let run the applet.

The other main option for Java<->Erlang communication is UBF:
http://www.sics.se/~joe/ubf/site/home.html (more experimental, but
generally simpler.)

Cheers,
Luke




More information about the erlang-questions mailing list