Search code examples
javaappletportlisten

Can a Java applet function as a server?


Is it possible to write a Java applet that can be a server on the client machine within the client's local network?

To be more specific, what I am looking to do is tunnel non-web traffic over the web. The sender would send to the applet, which would then forward the received data back to the server.

Is this sort of thing possible? What are the restrictions that might get in the way?

Note: I know that the applet can connect back to the server, that isn't an issue. The issue is whether or not an applet can listen for a connection / data on a local, client-side port.


Solution

  • An unsigned applet can only connect the host they come from.

    A signed applet can do any connection you want and can listen on tcp-ip ports.

    Source : http://docs.oracle.com/javase/tutorial/deployment/applet/security.html