Solved

reading file over the net

Posted on 1998-05-14
1
181 Views
Last Modified: 2010-04-16
HI

I want to be able to instantiate a class (data values) by accessing a file at
the originating site. I have set up my own server and I have to fight thru a
firewall. I tried socket connecting back to the applet's originating site but
had no success. What would be the best way to do this in Java?
RMI? Servlets?  I do not have a servlet server though...

Thanks!
0
Comment
Question by:jinjool
1 Comment
 
LVL 7

Accepted Solution

by:
faster earned 100 total points
ID: 1221032
I assume that you already know how to access an http server without a firewall, otherwise let me know.

To go through a firewall, your applet must first know the proxy server's address, I mean the IP address and port (normally 8080), then open a connection to the proxy server rather than web server, then send the request as following:

GET http://www.yourserver/yourpath HTTP/1.0
Host: www.yourserver

Please not that this is only the minimum reuqest header, what you should do is first to replace add the host part to your request line, the other headers should remain.  After that the proxy server will send you everything, as though you were directly connecting to the web server.

A servlet does not help.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

828 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