DefaultProxyConnectProtocol extends AbstractProxyProtocol<ProxyConnectProtocolParser> implements ProxyConnectProtocol { @Override public CompressAlgorithm getCompressAlgorithm() { if(isCompressed()) { CompressParser compressParser = (CompressParser) ((ProxyContentParser)parser.getProxyOptionParser(PROXY_OPTION.CONTENT)).getSubOption(); return compressParser.getAlgorithm(); } return null; } DefaultProxyConnectProtocol(ProxyConnectProtocolParser parser); @Override List<ProxyEndpoint> nextEndpoints(); @Override void recordForwardFor(InetSocketAddress address); @Override String getForwardFor(); @Override void setContent(String content); @Override String getContent(); @Override String getRouteInfo(); @Override String getFinalStation(); @Override String getSource(); @Override boolean isCompressed(); @Override CompressAlgorithm getCompressAlgorithm(); @Override void removeCompressOptionIfExist(); @Override void addCompression(CompressAlgorithm algorithm); @Override String toString();  }
@Test public void testGetCompressAlgorithm() { Assert.assertFalse(protocol.isCompressed()); DefaultProxyConnectProtocolParser parser = new DefaultProxyConnectProtocolParser(); DefaultProxyConnectProtocol protocol = (DefaultProxyConnectProtocol) parser.read("PROXY ROUTE PROXYTLS: Assert.assertTrue(protocol.isCompressed()); Assert.assertEquals(CompressAlgorithm.AlgorithmType.ZSTD, protocol.getCompressAlgorithm().getType()); Assert.assertEquals("1.0", protocol.getCompressAlgorithm().version()); }