?
Solved

Java security within a browser

Posted on 1998-02-16
3
Medium Priority
?
184 Views
Last Modified: 2010-04-16
Hm... I am pretty new to java. I was pretty much surprised after a couple of days of work to find out that simple

Socket s = new Socket ("somewhere.com", PORT);

doesn't work!!! Neither IE nor Netscape. The latter throws a security exception, and the former one just gets stuck! Don't tell me I can't create a socket when running an applet form a browser?!?!?!

Is there a way to solve this?
0
Comment
Question by:shaqshup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 120 total points
ID: 1233071
You can only open a socket to the machine that has served your applet. That's the rule. So, if your applet comes from A.com, you can't open a socket to B.com.

The only work-around is at the server-side. For example, write a CGI script that opens the stream for you and forward it to your applet.
0
 

Expert Comment

by:ashexpert
ID: 1233072
alternatively you need to have signed applets

and insted of CGI script sbetter alternative is servlets!
0
 

Author Comment

by:shaqshup
ID: 1233073
What are servlets? And how do you make signed applets? CAB files, or something else?
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question