package cj.proxy;

import org.restlet.Component;
import org.restlet.data.Protocol;

public class ProxyMain {

    public static void main(String[] args) {
        try {
        	int listeningPort = Integer.parseInt(args[0]);
        	String serverUri = args[1];

            // Create a new Component.
            Component component = new Component();

            // Add a new HTTP server listening on port 8182.
            component.getServers().add(Protocol.HTTP, listeningPort);
            component.getClients().add(Protocol.HTTP);

            // Attach the sample application.
            component.getDefaultHost().attachDefault(new ProxyApplication(serverUri));

            // Start the component.
            component.start();
        } catch (Exception e) {
            // Something is wrong.
            e.printStackTrace();
        }
    }
}
