1 package ch
.cyberduck
.core
.socket
;
4 * Copyright (c) 2002-2015 David Kocher. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch
20 import org
.apache
.commons
.net
.DefaultSocketFactory
;
22 import java
.io
.IOException
;
23 import java
.net
.InetAddress
;
24 import java
.net
.Proxy
;
25 import java
.net
.Socket
;
30 public class HttpProxySocketFactory
extends DefaultSocketFactory
{
32 private final Proxy proxy
;
34 public HttpProxySocketFactory(final Proxy proxy
) {
39 public Socket
createSocket() throws IOException
{
40 return new HttpProxyAwareSocket(proxy
);
44 public Socket
createSocket(final String host
, final int port
) throws IOException
{
45 return super.createSocket(host
, port
);
49 public Socket
createSocket(final InetAddress address
, final int port
) throws IOException
{
50 return super.createSocket(address
, port
);
54 public Socket
createSocket(final String host
, final int port
, final InetAddress localAddr
, final int localPort
) throws IOException
{
55 return super.createSocket(host
, port
, localAddr
, localPort
);
59 public Socket
createSocket(final InetAddress address
, final int port
, final InetAddress localAddr
, final int localPort
) throws IOException
{
60 return super.createSocket(address
, port
, localAddr
, localPort
);