package com.jscape.inet.util;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public interface Proxy {
    /**
     * connect to the proxy with the parameters given
     *
     * @param socketFactory
     * @param host
     * @param port
     * @param timeout
     */
    void connect(SocketFactory socketFactory, String host, int port, long timeout)
            throws Exception;

    /**
     * get the inputstream for the connection
     *
     * @return InputStream
     */
    InputStream getInputStream();

    /**
     * Get the output stream for the connection
     *
     * @return OutputStream
     */
    OutputStream getOutputStream();

    /**
     * get the actual socket in question
     *
     * @return Socket
     */
    Socket getSocket();

    /**
     * close the connection to the proxy
     */
    void close();
}
