publicstaticvoid main (String args[]) throws Exception {
MyAuthenticator auth = new MyAuthenticator ();
Authenticator.setDefault (auth);
InetAddress loopback = InetAddress.getLoopbackAddress();
ServerSocket ss = new ServerSocket();
ss.bind(new InetSocketAddress(loopback, 0)); int port = ss.getLocalPort ();
BasicServer server = new BasicServer (ss); synchronized (server) {
server.start();
System.out.println ("client 1");
String base = URIBuilder.newBuilder()
.scheme("http")
.loopback()
.port(port)
.path("/d1/")
.build()
.toString();
System.out.println("Base URL: " + base);
URL url = new URL (base + "d3/foo.html");
URLConnection urlc = url.openConnection(Proxy.NO_PROXY);
InputStream is = urlc.getInputStream ();
read (is);
System.out.println ("client 2");
url = new URL (base + "d2/bar.html");
urlc = url.openConnection(Proxy.NO_PROXY);
is = urlc.getInputStream ();
System.out.println ("client 3");
url = new URL (base + "d4/foobar.html");
urlc = url.openConnection(Proxy.NO_PROXY);
is = urlc.getInputStream ();
read (is);
server.wait (); if (!server.success) { thrownew RuntimeException ("3rd request did not use pre-emptive authorization");
}
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.26Bemerkung:
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.