Solved

reading file over the net

Posted on 1998-05-14
1
157 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

758 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

22 Experts available now in Live!

Get 1:1 Help Now