Skip to content

Commit a34d5fc

Browse files
Removed deprecated proxy connect methods from SocketClient
- Removed custom Jdk7HttpProxySocket class
1 parent cab7731 commit a34d5fc

File tree

3 files changed

+0
-174
lines changed

3 files changed

+0
-174
lines changed

src/main/java/com/hierynomus/sshj/backport/JavaVersion.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/java/com/hierynomus/sshj/backport/Jdk7HttpProxySocket.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/main/java/net/schmizz/sshj/SocketClient.java

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package net.schmizz.sshj;
1717

18-
import com.hierynomus.sshj.backport.JavaVersion;
19-
import com.hierynomus.sshj.backport.Jdk7HttpProxySocket;
2018
import net.schmizz.sshj.connection.channel.Channel;
2119
import net.schmizz.sshj.connection.channel.direct.DirectConnection;
2220

@@ -26,7 +24,6 @@
2624
import java.io.OutputStream;
2725
import java.net.InetAddress;
2826
import java.net.InetSocketAddress;
29-
import java.net.Proxy;
3027
import java.net.Socket;
3128

3229
public abstract class SocketClient {
@@ -57,73 +54,6 @@ protected InetSocketAddress makeInetSocketAddress(String hostname, int port) {
5754
return new InetSocketAddress(hostname, port);
5855
}
5956

60-
/**
61-
* Connect to a host via a proxy.
62-
* @param hostname The host name to connect to.
63-
* @param proxy The proxy to connect via.
64-
* @deprecated This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a {@link javax.net.SocketFactory}
65-
* into the SocketClient. The SocketFactory should create sockets using the {@link java.net.Socket#Socket(java.net.Proxy)} constructor.
66-
*/
67-
@Deprecated
68-
public void connect(String hostname, Proxy proxy) throws IOException {
69-
connect(hostname, defaultPort, proxy);
70-
}
71-
72-
/**
73-
* Connect to a host via a proxy.
74-
* @param hostname The host name to connect to.
75-
* @param port The port to connect to.
76-
* @param proxy The proxy to connect via.
77-
* @deprecated This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a {@link javax.net.SocketFactory}
78-
* into the SocketClient. The SocketFactory should create sockets using the {@link java.net.Socket#Socket(java.net.Proxy)} constructor.
79-
*/
80-
@Deprecated
81-
public void connect(String hostname, int port, Proxy proxy) throws IOException {
82-
this.hostname = hostname;
83-
this.port = port;
84-
if (JavaVersion.isJava7OrEarlier() && proxy.type() == Proxy.Type.HTTP) {
85-
// Java7 and earlier have no support for HTTP Connect proxies, return our custom socket.
86-
socket = new Jdk7HttpProxySocket(proxy);
87-
} else {
88-
socket = new Socket(proxy);
89-
}
90-
socket.connect(makeInetSocketAddress(hostname, port), connectTimeout);
91-
onConnect();
92-
}
93-
94-
/**
95-
* Connect to a host via a proxy.
96-
* @param host The host address to connect to.
97-
* @param proxy The proxy to connect via.
98-
* @deprecated This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a {@link javax.net.SocketFactory}
99-
* into the SocketClient. The SocketFactory should create sockets using the {@link java.net.Socket#Socket(java.net.Proxy)} constructor.
100-
*/
101-
@Deprecated
102-
public void connect(InetAddress host, Proxy proxy) throws IOException {
103-
connect(host, defaultPort, proxy);
104-
}
105-
106-
/**
107-
* Connect to a host via a proxy.
108-
* @param host The host address to connect to.
109-
* @param port The port to connect to.
110-
* @param proxy The proxy to connect via.
111-
* @deprecated This method will be removed after v0.12.0. If you want to connect via a proxy, you can do this by injecting a {@link javax.net.SocketFactory}
112-
* into the SocketClient. The SocketFactory should create sockets using the {@link java.net.Socket#Socket(java.net.Proxy)} constructor.
113-
*/
114-
@Deprecated
115-
public void connect(InetAddress host, int port, Proxy proxy) throws IOException {
116-
this.port = port;
117-
if (JavaVersion.isJava7OrEarlier() && proxy.type() == Proxy.Type.HTTP) {
118-
// Java7 and earlier have no support for HTTP Connect proxies, return our custom socket.
119-
socket = new Jdk7HttpProxySocket(proxy);
120-
} else {
121-
socket = new Socket(proxy);
122-
}
123-
socket.connect(new InetSocketAddress(host, port), connectTimeout);
124-
onConnect();
125-
}
126-
12757
public void connect(String hostname) throws IOException {
12858
connect(hostname, defaultPort);
12959
}

0 commit comments

Comments
 (0)