Solved

Java security within a browser

Posted on 1998-02-16
3
143 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
3 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 30 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now