Create a proxy object

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2006
Posts: 68
Reputation: rpjanaka is an unknown quantity at this point 
Solved Threads: 0
rpjanaka rpjanaka is offline Offline
Junior Poster in Training

Create a proxy object

 
0
  #1
Sep 22nd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Create a proxy object

 
0
  #2
Sep 22nd, 2006
see the API docs.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC