| | |
Create a proxy object
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2006
Posts: 68
Reputation:
Solved Threads: 0
hi im janaka priyadarshana
for get data frome a particuler URL I want to set may proxy. for that i want to create a proxy object with java. the following is the code segment.
import java.net.*;
import java.io.*;
import java.net.Proxy;
public class MyURLConnection {
private URL myURL;
private URLConnection myConnection;
private String address;
private Proxy myProxy;
private void readURL(String address) {
try {
myURL = new URL(address);
myProxy = new Proxy();
myConnection = myURL.openConnection(myProxy);
} catch (MalformedURLException ex) {
System.out.print("can not create url object");
} catch (IOException ex) {
System.out.print("Can not open the connection");
}
}
to create a proxy object it is require a as following parameters.
Proxy(Proxy.Type type, SocketAddress sa)
for give these two parameters i dont know what they are?
i know only my proxy name and its port address.
please can anyone help me.
thank you.
for get data frome a particuler URL I want to set may proxy. for that i want to create a proxy object with java. the following is the code segment.
import java.net.*;
import java.io.*;
import java.net.Proxy;
public class MyURLConnection {
private URL myURL;
private URLConnection myConnection;
private String address;
private Proxy myProxy;
private void readURL(String address) {
try {
myURL = new URL(address);
myProxy = new Proxy();
myConnection = myURL.openConnection(myProxy);
} catch (MalformedURLException ex) {
System.out.print("can not create url object");
} catch (IOException ex) {
System.out.print("Can not open the connection");
}
}
to create a proxy object it is require a as following parameters.
Proxy(Proxy.Type type, SocketAddress sa)
for give these two parameters i dont know what they are?
i know only my proxy name and its port address.
please can anyone help me.
thank you.
![]() |
Similar Threads
- Design Pattern - Proxy (Computer Science)
- how to use session object. (ASP.NET)
- Create proxy class from WSDL (.net & java) (XML, XSLT and XPATH)
- call a method in an object, by giving the same object as the parameter (Java)
- I want to learn - How to create and use objects. (C#)
- getting an object from a given string (Java)
- what is object oriented???? (IT Professionals' Lounge)
Other Threads in the Java Forum
- Previous Thread: check compatibility of versions
- Next Thread: Seeking Experienced Java/J2EE Developer
| Thread Tools | Search this Thread |
Tag cloud for Java
actionlistener android api apple applet application apps arguments array arrays automation balls binary bluetooth card chat class classes client code component consumer database draw eclipse ee error event exception fractal free game gameprogramming gis givemetehcodez graphics gui helpwithhomework html ide image input integer j2me j2seprojects java javaprojects jmf jni jpanel julia jvm key linux list loop machine map method methods migrate mobile mobiledevelopmentcreatejar myaggfun netbeans newbie nextline nls number oracle output print problem program programming project recursion recursive scanner screen security server set size sms socket sort spamblocker sql sqlite string sun swing terminal test threads time tree trolltech windows






