/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4920526
* @summary Needs per connection proxy support for URLs
* @build ClosedChannelList HttpServer HttpTransaction HttpCallback
* @compile PerConnectionProxy.java
*/
try {
req.orderlyClose();
} catch (IOException e) {
}
}
try {
// start proxy server
// for non existing proxy expect an IOException
try {
throw new RuntimeException("non existing per connection proxy should lead to IOException");
} catch (IOException ioex) {
// expected
}
// for NO_PROXY, expect direct connection
try {
urlc.disconnect();
} catch (IOException ioex) {
}
// for a normal proxy setting expect to see connection
// goes through that proxy
try {
urlc.disconnect();
} catch (IOException ioex) {
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
}
}
}
// client requesting for a tunnel
/*
* Origin server's address and port that the client
* wants to establish the tunnel for communication.
*/
private int serverPort;
serverPort = port;
}
public void run() {
try {
} catch (Exception e) {
e.printStackTrace();
try {
}
catch (IOException excep) {
}
}
}
// connection set to the tunneling mode
}
/**
***************************************************************
* helper methods follow
***************************************************************
*/
public int getPort() {
return ss.getLocalPort();
}
/*
* This inner class provides unidirectional data flow through the sockets
* by continuously copying bytes from the input socket onto the output
* socket, until both sockets are open and EOF has not been received.
*/
throws Exception {
}
public void run() {
int BUFFER_SIZE = 400;
byte[] buf = new byte[BUFFER_SIZE];
int bytesRead = 0;
try {
}
} catch (IOException e) {
/*
* The peer end has closed the connection
* we will close the tunnel
*/
close();
}
}
public void close() {
try {
} catch (IOException ignored) { }
}
}
}
}