944,206 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 5930
  • Java RSS
Sep 22nd, 2006
0

Create a proxy object

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
rpjanaka is offline Offline
69 posts
since Sep 2006
Sep 22nd, 2006
0

Re: Create a proxy object

see the API docs.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: check compatibility of versions
Next Thread in Java Forum Timeline: Seeking Experienced Java/J2EE Developer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC