@Override
    public Connection createConnection(String host, int port) throws IOException {
        try {
            Socket socket;
            SocketFactory socketFactory;
            socketFactory = config.isUsingSSL() && config.getHttpProxyHost() == null
                    ? SSLSocketFactory
                            .getDefault()
                    : SocketFactory.getDefault();
            if (config.getHttpProxyHost() != null) {
                // setup the proxy tunnel
                socket = socketFactory.createSocket();
                // jsmpp uses enquire link timer as socket read timeout, so also use it to establish the initial connection
                socket.connect(new InetSocketAddress(config.getHttpProxyHost(), config.getHttpProxyPort()),
                        config.getEnquireLinkTimer());
                connectProxy(host, port, socket);
            } else {
                socket = socketFactory.createSocket();
                // jsmpp uses enquire link timer as socket read timeout, so also use it to establish the initial connection
                socket.connect(new InetSocketAddress(host, port), config.getEnquireLinkTimer());
            }

            if (config.isUsingSSL() && config.getHttpProxyHost() != null) {
                // Init the SSL socket which is based on the proxy socket
                SSLSocketFactory sslSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
                SSLSocket sslSocket = (SSLSocket) sslSocketFactory.createSocket(socket, host, port, true);
                sslSocket.startHandshake();
                socket = sslSocket;
            }

            return new SocketConnection(socket);
        } catch (Exception e) {
            throw new IOException(e.getMessage(), e);
        }
    }
@Test
    @Disabled("Must be manually tested")
    public void createConnection() throws IOException {
        SmppConfiguration configuration = new SmppConfiguration();
        SmppConnectionFactory factory = SmppConnectionFactory.getInstance(configuration);
        Connection connection = factory.createConnection("localhost", 2775);

        try {
            assertNotNull(connection);
            assertTrue(connection.isOpen());
        } finally {
            if (connection != null) {
                connection.close();
            }
        }
    }