🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #23820

how to pass through our proxy in jsp?

#23820
From: Rush Woo
Date: Sun, 16 Apr 2000 00:00
95 lines
4443 bytes
Hi, everyone !
I have a problem when coding jsp program.
My computer which installed MS Proxy Client 2.0 is behind a firewall
which is running MS Proxy on Windows NT and authorization is base on
Windows NT domain account authorization,
My web server is apache 1.3.9 for winNT with JRun 4.0(using jre 1.2).
I have writen a JSP program like the list, it works well if the URL is
a site in my local network, but when the URL has been changed to
a site of Internet, just like the listed source, I get the error message.

Please tell me how to pass through our proxy in jsp?
Please respond by e-mail: rushwoo@hengsys.com.cn
or post the answer in this news group!
Thanx!

500 Internal Server Error
/tools/tst.jsp:

Connection refused: no further information
java.net.ConnectException: Connection refused: no further information
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(Unknown Source)
 at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
 at java.net.PlainSocketImpl.connect(Unknown Source)
 at java.net.Socket.(Unknown Source)
 at java.net.Socket.(Unknown Source)
 at sun.net.NetworkClient.doConnect(Unknown Source)
 at sun.net.www.http.HttpClient.openServer(Unknown Source)
 at sun.net.www.http.HttpClient.openServer(Unknown Source)
 at sun.net.www.http.HttpClient.(Unknown Source)
 at sun.net.www.http.HttpClient.(Unknown Source)
 at sun.net.www.http.HttpClient.New(Unknown Source)
 at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
 at jrun__tools__tst2ejspe._jspService(jrun__tools__tst2ejspe.java, Compiled
Code)
 at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
 at allaire.jrun.servlet.JRunSE.service(JRunSE.java:910)
 at
allaire.jrun.servlet.JRunServletLoader.service(JRunServletLoader.java:198)
 at allaire.jrun.debug.StackManager.service(StackManager.java:61)
 at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
 at
allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:47
)
 at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:160)
 at allaire.jrun.Service.service(Service.java:156)
 at allaire.jrun.servlet.JRunSE.service(JRunSE.java:910)
 at
allaire.jrun.servlet.JRunServletLoader.service(JRunServletLoader.java:198)
 at allaire.jrun.debug.StackManager.service(StackManager.java:61)
 at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
 at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.jav
a:116)
 at allaire.jrun.servlet.JRunSE.service(JRunSE.java:959)
 at allaire.jrun.servlet.JRunSE.service(JRunSE.java:910)
 at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
 at
allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.jav
a:116)
 at allaire.jrun.servlet.JvmContext.forward(JvmContext.java:308)
 at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:342)
 at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
 at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)


here is my source, the URL is an internet web site,

<%@ page import="java.io.*"
%>
<%@ page import="java.net.*"
%>
<%@ page import="java.lang.*"
%>
<%@ page import="java.util.*"
%>
<html>
<head>
<%
     URL newsURL = new URL( "http://dailynews.263.net/" );
     HttpURLConnection conn = (HttpURLConnection) newsURL.openConnection();
     InputStream is = conn.getInputStream();
     DataInputStream dis = new DataInputStream( is );

     String md = "rw";
     String ln;
     RandomAccessFile fo =new RandomAccessFile( "c:/temp/a.html", md );

     while( (ln=dis.readLine()) != null ) {
          fo.writeBytes( ln+"\n" );
     }
     fo.close();
%>
</body>
</html>
Technical Details
Message-ID: <8dbbkl$26ta$1@news.cz.js.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6cb0,acd3eb1e4f34e994
X-Google-Attributes: gidf6cb0,public
From: "Rush Woo" <rushwoo@hengsys.com.cn>
Subject: how to pass through our proxy in jsp?
Date: 2000/04/16
Message-ID: <8dbbkl$26ta$1@news.cz.js.cn>
X-Deja-AN: 611723771
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
X-Complaints-To: usenet@news.cz.js.cn
X-Trace: news.cz.js.cn 955855317 72618 210.74.150.129 (16 Apr 2000 03:21:57 GMT)
Organization: The news server of Changzhou TeleCom
X-MSMail-Priority: Normal
NNTP-Posting-Date: 16 Apr 2000 03:21:57 GMT
Newsgroups: cn.bbs.comp.lang.java