I am attempting to implement an HTTP tunnel using similar techniques to those employed by web browsers to simulate a full-duplex connection, in Java using the Netty framework. I wish to ... |
Is there a way of getting internet connection settings (proxy information) being used by java to connect to the internet?
With Java 1.5 you can use the ProxySelector introduced then, ... |
I'm trying to find a way to force any connection attempts a Jar makes to an external IP through my proxy server, which is running on localhost(Also a Java application).
Once the ... |
How can I set the SOCKS proxy for a URLConnection given by (new URL(url)).openConnection()?
Different proxies are needed on a per-connection basis, so please don't suggest setting system properties.
|
I need to create a single http proxy connection and i don't want to use java common environment variables such as http.proxyHost and http.proxyPort (should i care about modifying them?).
There is ... |
Im creating several proxy sockets and binding them to another server. Can i create more than 1 instance of the proxy socket? For example having 4 Sockets using the same proxy?
... |
i have some code to test if the proxy server and port is working ,some of the code like this:
System.getProperties().put("proxySet", "true");
System.getProperties().put("https.proxyHost", "localhost");
System.getProperties().put("https.proxyPort", "1234");
System.getProperties().put("http.proxyHost", "localhost");
System.getProperties().put("http.proxyPort", "1234");
HttpURLConnection conn = (HttpURLConnection) new URL("https://www.google.com").openConnection();
conn.getContent();
conn.disconnect();
it seems ... |
|
Experimentally, java.net.URL cycles through the list of proxies returned by java.net.ProxySelector.select(URI) until if finds one that works. However, once java.net.Socket encounters a broken proxy it is unable to recover. Is this ... |
I'm writing a web scraper in Java but I'm behind a proxy server and it's making things very difficult.
This is the connection code:
public void scrape(String url, String filename) throws Exception {
...
|
I'm trying to test a SOCKS proxy that's under load from multiple machines. The outline of my code is something along the lines of
- Connect directly to the server with one client, ...
|
I am trying to sort through a list of SOCKS proxies, and figure out which ones have a connect and read time of less than 1000ms, here is my code
for(Proxy p ...
|
Is it possible to make a Direct connection to the Internet without using a Proxy.
Consider a case that my Organization has a Proxy and I use the DIRECT option given in ... |
I have to call a WS that requires custom client authentication. This authentication is done by a program running on the client and listening on http://127.0.0.1:80.
So I add a ... |
I searched google, this site and JavaRanch and I can not find an answer.
My program needs to obtain proxies from a selected file(I got that done using java gui FileChooser class ... |
I am trying to create url connection using a proxy at run time. My code is below:
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.10.100.100", 80));
HttpURLConnection connection =
(HttpURLConnection)new URL("http://abc.abcd.com").openConnection(proxy);
But ... |
I am very new with Java. I am using following code for the calling REST API, its working fine in simple environment but when I used with proxy environment Its throwing ... |
Hello Everyone I've one application which opens a socket to connect and retrieve data from internet. Now my machine has gone behind a proxy server and I'm not able to connect to internet from my same old aplication. Can anyone pls. help me as how to solve this problem.. How can I provide the username and password to connect to the ... |
|
|
|
Hi All, Some technical help required: While establishing connection using urlconnection or httpurlconnection, I want to bypass the proxy server for sure (irrespective of whether proxy server setting are there or not) is there any way of doing it??? I know i can remove the setting and then procced, but dont want to do that as another piece of code ... |
Just want to save some time dealing with search engines. For Windows platform primary, but for some others can be good too. I want to apply proxy settings to URL connection based on proxy settings set for IE/FF or other browser. I guess I can use package java.util.prefs for reading Windows Registry for proxy setting values. Then I can use System.getProperties().put( ... |
Hi to all! At my work place we have a proxy server and on each machine we have a proxy client. With everything enabled, I can send emails and connect to sockets on Internet without any problems. However, we are now switching to opening the sockets on a VPN; I have found that for this to properly work, I must disable ... |
I am trying to open a socket to an address out of the company network and thus firewalled. I tried the following but it doesnt seem to do anything. I see the proxy object gets created, but the when the socket tries to connect, it just seems to get blocked. Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("webproxy.blah.com", 80)); Socket socket = ... |
Hi, I am trying to invoke url from java. I used the following code to do this: URL url = null; HttpURLConnection connection = null; InputStream inStream = null; Authenticator.setDefault(new UserAuthenticate("itlinfosys\\chaya_somanchi", "mypwd")); System.out.println("After Authenticator"); String proxy_addr = "172.25.232.28"; int proxy_port = 80; addr = new InetSocketAddress(proxy_addr,proxy_port); System.out.println("After SocketAddress "+addr.toString()); System.out.println("Proxy Type: "+Proxy.Type.HTTP.toString()); proxy = new Proxy(Proxy.Type.HTTP, addr); connection = (HttpURLConnection)url.openConnection(proxy); connection.connect(); ... |
|
|
|
Ha, ha, nice try... If you want people to try out random code posted over the Web, at least make it easy and appealling to them: - please provide an [SSCCE|http://sscce.org]. Don't expect us to fill in the blanks to have this compile and run. - Please provide a description of the desired vs undesired behavior (not so clear from your ... |
Hi all, I need help! i have web server in our network, but i need get pages ONLY via proxy, not directly! I try next(and others): class SimpleAuthenticator extends Authenticator { private String username, password; public SimpleAuthenticator(String username, String password) { this.username = username; this.password = password; } protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication( username, password.toCharArray()); } } Authenticator.setDefault(new SimpleAuthenticator( ... |
Hi, I am getting the following error, when i connect to a URL using proxy: Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150) at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:117) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1584) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:866) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1030) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1057) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1041) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:402) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:857) at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getOutputStream(HttpsURLConnectionOldImpl.java:200) The URL does use a digital certificate , but i do not have it yet, ... |
Mainly because it's in the spec. I did not figure out exactly why it is necessary to use different dns servers. Let me give you a quick glimpse what the application should do: The application checks if a URL is still available and returns an xml file with a return code (401 for example), connection time, an extract of thesource code ... |
The same mechanism can be used to specify that a particular URL has to be reached directly, because it's on the intranet for example. That's where the DIRECT type comes into play. But, you don't need to create a proxy instance with the DIRECT type, all you have to do is use the NO_PROXY static member: |