forked from I2P_Developers/i2p.i2p
Test SOCKS4 client: CONNECTION_REFUSED when connecting
This commit is contained in:
@@ -87,6 +87,22 @@ public class SOCKS4ClientTest {
|
||||
80);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Check that CONNECTION_REFUSED throws exception
|
||||
*/
|
||||
@Test
|
||||
public void connect__responseCONNECTION_REFUSED() {
|
||||
assertThrows(SOCKSException.class, () -> {
|
||||
SOCKS4Client.connect(new ByteArrayInputStream(new byte[]{
|
||||
0, // dummy
|
||||
SOCKS4Constants.Reply.CONNECTION_REFUSED, // Connection succeeded
|
||||
}),
|
||||
new ByteArrayOutputStream(),
|
||||
"1.1.1.1",
|
||||
80
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* IPv6 is not supported by this SOCKS client so it just throws an exception
|
||||
|
||||
Reference in New Issue
Block a user