test/java/net/ProxySelector/LoopbackAddresses.java
Print this page
*** 23,33 ****
/* @test
* @bug 4924226
* @summary PIT: Can no launch jnlp application via 127.0.0.1 address on the web server
* @library ../../../sun/net/www/httptest/
! * @build ClosedChannelList HttpServer HttpTransaction HttpCallback
* @compile LoopbackAddresses.java
* @run main/othervm LoopbackAddresses
*/
import java.net.*;
--- 23,33 ----
/* @test
* @bug 4924226
* @summary PIT: Can no launch jnlp application via 127.0.0.1 address on the web server
* @library ../../../sun/net/www/httptest/
! * @build ClosedChannelList TestHttpServer HttpTransaction HttpCallback
* @compile LoopbackAddresses.java
* @run main/othervm LoopbackAddresses
*/
import java.net.*;
*** 37,47 ****
* Our default proxy selector should bypass localhost and loopback
* addresses when selecting proxies. This is the existing behaviour.
*/
public class LoopbackAddresses implements HttpCallback {
! static HttpServer server;
public void request (HttpTransaction req) {
req.setResponseEntityBody ("Hello .");
try {
req.sendResponse (200, "Ok");
--- 37,47 ----
* Our default proxy selector should bypass localhost and loopback
* addresses when selecting proxies. This is the existing behaviour.
*/
public class LoopbackAddresses implements HttpCallback {
! static TestHttpServer server;
public void request (HttpTransaction req) {
req.setResponseEntityBody ("Hello .");
try {
req.sendResponse (200, "Ok");
*** 50,60 ****
}
}
public static void main(String[] args) {
try {
! server = new HttpServer (new LoopbackAddresses(), 1, 10, 0);
ProxyServer pserver = new ProxyServer(InetAddress.getByName("localhost"), server.getLocalPort());
// start proxy server
new Thread(pserver).start();
System.setProperty("http.proxyHost", "localhost");
--- 50,60 ----
}
}
public static void main(String[] args) {
try {
! server = new TestHttpServer (new LoopbackAddresses(), 1, 10, 0);
ProxyServer pserver = new ProxyServer(InetAddress.getByName("localhost"), server.getLocalPort());
// start proxy server
new Thread(pserver).start();
System.setProperty("http.proxyHost", "localhost");