File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes socket to applet inside a browser ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "socket to applet inside a browser ?" Watch "socket to applet inside a browser ?" New topic
Author

socket to applet inside a browser ?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How can an applet(from within the browser) communicate to a socket on local machine?
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
An applet can only communicate with sockets on the machine it was served from, unless it is signed and the user has agreed to let it do it.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I did that and I was able to get an appletinside the browser to write a file to my hard disk but, following the same procedure of digitalsigning for opening network connections error isn't working as of now..will keep informed if things change ..but i read somewhere that sometimes browser is not smart enough to interpret "localhost"...ie.can't understand that the .class file has been loaded from the same machine..if you can elaborate..more cause basically i am trying to get an applet work for a chat program..
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I think the best way to do this is through applet/servlet communication. That way you don't need any certificates, you don't have to worry about moving the chat server to a different machine than the web server, etc.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Does the applet/servlet combination work a bit slow?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
It works at internet speed. I haven't had any trouble using the combination.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: socket to applet inside a browser ?
 
Similar Threads
Applet interacts with server.
how to stop server?
How server can send notification without sending n e req.
how an Applet can make a socket on local port
Socket connections and Browser